brotherton-erpnext/erpnext/patches/v13_0/remove_bad_selling_defaults.py
2022-03-28 18:52:46 +05:30

17 lines
496 B
Python

import frappe
from frappe import _
def execute():
frappe.reload_doctype("Selling Settings")
selling_settings = frappe.get_single("Selling Settings")
if selling_settings.customer_group in (_("All Customer Groups"), "All Customer Groups"):
selling_settings.customer_group = None
if selling_settings.territory in (_("All Territories"), "All Territories"):
selling_settings.territory = None
selling_settings.flags.ignore_mandatory = True
selling_settings.save(ignore_permissions=True)