Browse Source
* feat: crm settings * feat: CRM Settings * feat: lead and opprtunity section * feat: added CRM Settings in ERPNext Settings workspace * fix: review chnages * added patch * fix: linter issues * fix: linter issues * fix: linter issues * fix: removed crm settings from selling module * fix: raw query to frappe.qb * fix: removed hardcoded value * fix: linter issue * fix: simplify CRM Settings migration patch Co-authored-by: Anupam Kumar <anupam@Anupams-MacBook-Air.local> Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>develop
Anupam Kumar
3 years ago
committed by
GitHub
12 changed files with 250 additions and 114 deletions
@ -0,0 +1,8 @@ |
|||
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('CRM Settings', { |
|||
// refresh: function(frm) {
|
|||
|
|||
// }
|
|||
}); |
@ -0,0 +1,114 @@ |
|||
{ |
|||
"actions": [], |
|||
"creation": "2021-09-09 17:03:22.754446", |
|||
"description": "Settings for Selling Module", |
|||
"doctype": "DocType", |
|||
"document_type": "Other", |
|||
"engine": "InnoDB", |
|||
"field_order": [ |
|||
"section_break_5", |
|||
"campaign_naming_by", |
|||
"allow_lead_duplication_based_on_emails", |
|||
"column_break_4", |
|||
"create_event_on_next_contact_date", |
|||
"auto_creation_of_contact", |
|||
"opportunity_section", |
|||
"close_opportunity_after_days", |
|||
"column_break_9", |
|||
"create_event_on_next_contact_date_opportunity", |
|||
"quotation_section", |
|||
"default_valid_till" |
|||
], |
|||
"fields": [ |
|||
{ |
|||
"fieldname": "campaign_naming_by", |
|||
"fieldtype": "Select", |
|||
"in_list_view": 1, |
|||
"label": "Campaign Naming By", |
|||
"options": "Campaign Name\nNaming Series" |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_9", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fieldname": "default_valid_till", |
|||
"fieldtype": "Data", |
|||
"label": "Default Quotation Validity Days" |
|||
}, |
|||
{ |
|||
"fieldname": "section_break_5", |
|||
"fieldtype": "Section Break", |
|||
"label": "Lead" |
|||
}, |
|||
{ |
|||
"default": "0", |
|||
"fieldname": "allow_lead_duplication_based_on_emails", |
|||
"fieldtype": "Check", |
|||
"label": "Allow Lead Duplication based on Emails" |
|||
}, |
|||
{ |
|||
"default": "1", |
|||
"fieldname": "auto_creation_of_contact", |
|||
"fieldtype": "Check", |
|||
"label": "Auto Creation of Contact" |
|||
}, |
|||
{ |
|||
"default": "1", |
|||
"fieldname": "create_event_on_next_contact_date", |
|||
"fieldtype": "Check", |
|||
"label": "Create Event on Next Contact Date" |
|||
}, |
|||
{ |
|||
"fieldname": "opportunity_section", |
|||
"fieldtype": "Section Break", |
|||
"label": "Opportunity" |
|||
}, |
|||
{ |
|||
"default": "15", |
|||
"description": "Auto close Opportunity Replied after the no. of days mentioned above", |
|||
"fieldname": "close_opportunity_after_days", |
|||
"fieldtype": "Int", |
|||
"label": "Close Replied Opportunity After Days" |
|||
}, |
|||
{ |
|||
"default": "1", |
|||
"fieldname": "create_event_on_next_contact_date_opportunity", |
|||
"fieldtype": "Check", |
|||
"label": "Create Event on Next Contact Date" |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_4", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fieldname": "quotation_section", |
|||
"fieldtype": "Section Break", |
|||
"label": "Quotation" |
|||
} |
|||
], |
|||
"icon": "fa fa-cog", |
|||
"index_web_pages_for_search": 1, |
|||
"issingle": 1, |
|||
"links": [], |
|||
"migration_hash": "3ae78b12dd1c64d551736c6e82092f90", |
|||
"modified": "2021-11-03 09:00:36.883496", |
|||
"modified_by": "Administrator", |
|||
"module": "CRM", |
|||
"name": "CRM Settings", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"create": 1, |
|||
"email": 1, |
|||
"print": 1, |
|||
"read": 1, |
|||
"role": "System Manager", |
|||
"share": 1, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
from frappe.model.document import Document |
|||
|
|||
|
|||
class CRMSettings(Document): |
|||
pass |
@ -0,0 +1,9 @@ |
|||
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors |
|||
# See license.txt |
|||
|
|||
# import frappe |
|||
import unittest |
|||
|
|||
|
|||
class TestCRMSettings(unittest.TestCase): |
|||
pass |
@ -0,0 +1,16 @@ |
|||
import frappe |
|||
|
|||
|
|||
def execute(): |
|||
settings = frappe.db.get_value('Selling Settings', 'Selling Settings', [ |
|||
'campaign_naming_by', |
|||
'close_opportunity_after_days', |
|||
'default_valid_till' |
|||
], as_dict=True) |
|||
|
|||
frappe.reload_doc('crm', 'doctype', 'crm_settings') |
|||
frappe.db.set_value('CRM Settings', 'CRM Settings', { |
|||
'campaign_naming_by': settings.campaign_naming_by, |
|||
'close_opportunity_after_days': settings.close_opportunity_after_days, |
|||
'default_valid_till': settings.default_valid_till |
|||
}) |
Loading…
Reference in new issue