From 105b6d498c11c2b2e37a377fa0fd1468edeb3eb2 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 5 Dec 2021 21:30:03 +0530 Subject: [PATCH] fix: remove bad defaults from selling settings "All cusotmer groups" and "All territories" are pointless defaults, not sure why these are made default. They don't help you track anything. "All" might as well be `Null`. Even the filters for customer_group suggest it shouldn't be group then having the root as default makes no sense. --- .../selling/doctype/selling_settings/selling_settings.py | 7 ------- erpnext/setup/setup_wizard/operations/install_fixtures.py | 1 - 2 files changed, 8 deletions(-) diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py index e7c5e76996..fb86e614b6 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/selling_settings.py @@ -8,7 +8,6 @@ import frappe from frappe.custom.doctype.property_setter.property_setter import make_property_setter from frappe.model.document import Document from frappe.utils import cint -from frappe.utils.nestedset import get_root_of class SellingSettings(Document): @@ -37,9 +36,3 @@ class SellingSettings(Document): editable_bundle_item_rates = cint(self.editable_bundle_item_rates) make_property_setter("Packed Item", "rate", "read_only", not(editable_bundle_item_rates), "Check", validate_fields_for_doctype=False) - - def set_default_customer_group_and_territory(self): - if not self.customer_group: - self.customer_group = get_root_of('Customer Group') - if not self.territory: - self.territory = get_root_of('Territory') diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 503aeacd01..98f9119885 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -303,7 +303,6 @@ def set_more_defaults(): def update_selling_defaults(): selling_settings = frappe.get_doc("Selling Settings") - selling_settings.set_default_customer_group_and_territory() selling_settings.cust_master_name = "Customer Name" selling_settings.so_required = "No" selling_settings.dn_required = "No"