brotherton-erpnext/erpnext/patches/v14_0/migrate_crm_settings.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
514 B
Python
Raw Normal View History

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')
2022-01-31 07:48:05 +00:00
if 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
})