Skip to content

Commit

Permalink
Merge pull request #238 from frappe/develop
Browse files Browse the repository at this point in the history
chore: Merge develop to main
  • Loading branch information
shariquerik authored Jul 1, 2024
2 parents d66a618 + 2afe23d commit fc0bca1
Show file tree
Hide file tree
Showing 19 changed files with 424 additions and 317 deletions.
9 changes: 4 additions & 5 deletions crm/api/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ def get_data(

for kc in kanban_columns:
column_filters = { column_field: kc.get('name') }
if column_field in filters and filters.get(column_field) != kc.name:
order = kc.get("order")
if column_field in filters and filters.get(column_field) != kc.name or kc.get('delete'):
column_data = []
else:
column_filters.update(filters.copy())
Expand All @@ -341,7 +342,6 @@ def get_data(
if kc.get("page_length"):
page_length = kc.get("page_length")

order = kc.get("order")
if order:
column_data = get_records_based_on_order(doctype, rows, column_filters, page_length, order)
else:
Expand Down Expand Up @@ -667,9 +667,6 @@ def get_fields(doctype: str, allow_all_fieldtypes: bool = False):
for field in fields:
if (
field.fieldtype not in not_allowed_fieldtypes
and not field.hidden
and not field.read_only
and not field.is_virtual
and field.fieldname
):
_fields.append({
Expand All @@ -678,6 +675,8 @@ def get_fields(doctype: str, allow_all_fieldtypes: bool = False):
"value": field.fieldname,
"options": field.options,
"mandatory": field.reqd,
"read_only": field.read_only,
"hidden": field.hidden,
})

return _fields
Expand Down
29 changes: 21 additions & 8 deletions crm/fcrm/doctype/twilio_settings/twilio_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
"enabled",
"column_break_avmt",
"record_calls",
"section_break_malx",
"section_break_eklq",
"account_sid",
"column_break_yqvr",
"auth_token",
"section_break_malx",
"api_key",
"api_secret",
"twiml_sid",
"column_break_idds",
"auth_token",
"twiml_sid"
"api_secret"
],
"fields": [
{
Expand All @@ -31,13 +33,15 @@
"fieldname": "api_key",
"fieldtype": "Data",
"label": "API Key",
"permlevel": 1
"permlevel": 1,
"read_only": 1
},
{
"fieldname": "api_secret",
"fieldtype": "Password",
"label": "API Secret",
"permlevel": 1
"permlevel": 1,
"read_only": 1
},
{
"fieldname": "column_break_idds",
Expand All @@ -54,7 +58,8 @@
"fieldname": "twiml_sid",
"fieldtype": "Data",
"label": "TwiML SID",
"permlevel": 1
"permlevel": 1,
"read_only": 1
},
{
"fieldname": "section_break_ssqj",
Expand All @@ -79,12 +84,20 @@
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
},
{
"fieldname": "section_break_eklq",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_yqvr",
"fieldtype": "Column Break"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-06-11 17:42:38.256260",
"modified": "2024-07-01 17:55:25.003703",
"modified_by": "Administrator",
"module": "FCRM",
"name": "Twilio Settings",
Expand Down
27 changes: 27 additions & 0 deletions crm/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def after_install():
add_default_fields_layout()
add_property_setter()
add_email_template_custom_fields()
add_default_industries()
add_default_lead_sources()
frappe.db.commit()

def add_default_lead_statuses():
Expand Down Expand Up @@ -196,3 +198,28 @@ def add_email_template_custom_fields():
)

frappe.clear_cache(doctype="Email Template")


def add_default_industries():
industries = ["Accounting", "Advertising", "Aerospace", "Agriculture", "Airline", "Apparel & Accessories", "Automotive", "Banking", "Biotechnology", "Broadcasting", "Brokerage", "Chemical", "Computer", "Consulting", "Consumer Products", "Cosmetics", "Defense", "Department Stores", "Education", "Electronics", "Energy", "Entertainment & Leisure, Executive Search", "Financial Services", "Food", "Beverage & Tobacco", "Grocery", "Health Care", "Internet Publishing", "Investment Banking", "Legal", "Manufacturing", "Motion Picture & Video", "Music", "Newspaper Publishers", "Online Auctions", "Pension Funds", "Pharmaceuticals", "Private Equity", "Publishing", "Real Estate", "Retail & Wholesale", "Securities & Commodity Exchanges", "Service", "Soap & Detergent", "Software", "Sports", "Technology", "Telecommunications", "Television", "Transportation", "Venture Capital"]

for industry in industries:
if frappe.db.exists("CRM Industry", industry):
continue

doc = frappe.new_doc("CRM Industry")
doc.industry = industry
doc.insert()


def add_default_lead_sources():

lead_sources = ["Existing Customer", "Reference", "Advertisement", "Cold Calling", "Exhibition", "Supplier Reference", "Mass Mailing", "Customer's Vendor", "Campaign", "Walk In"]

for source in lead_sources:
if frappe.db.exists("CRM Lead Source", source):
continue

doc = frappe.new_doc("CRM Lead Source")
doc.source_name = source
doc.insert()
2 changes: 1 addition & 1 deletion frappe-ui
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@vueuse/core": "^10.3.0",
"@vueuse/integrations": "^10.3.0",
"feather-icons": "^4.28.0",
"frappe-ui": "^0.1.61",
"frappe-ui": "^0.1.63",
"gemoji": "^8.1.0",
"lodash": "^4.17.21",
"mime": "^4.0.1",
Expand Down
Loading

0 comments on commit fc0bca1

Please sign in to comment.