brotherton-erpnext/erpnext/patches/v14_0/migrate_crm_settings.py
Anupam Kumar 3928a402d4
feat: CRM Settings (#27788)
* 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>
2021-12-06 13:52:00 +05:30

17 lines
495 B
Python

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
})