2021-12-05 16:30:52 +00:00
|
|
|
import frappe
|
|
|
|
from frappe import _
|
|
|
|
|
|
|
|
|
|
|
|
def execute():
|
2022-01-31 07:48:05 +00:00
|
|
|
frappe.reload_doctype("Selling Settings")
|
2021-12-05 16:30:52 +00:00
|
|
|
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)
|