From a8375239eb407d434a72a4c8b4ca81556908fb02 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 5 Dec 2021 22:07:14 +0530 Subject: [PATCH] test: set customer group and territory defaults --- erpnext/setup/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index 1478007da8..cad4c54d7d 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -53,6 +53,7 @@ def before_tests(): frappe.db.set_value("Stock Settings", None, "auto_insert_price_list_rate_if_missing", 0) enable_all_roles_and_domains() + set_defaults_for_tests() frappe.db.commit() @@ -127,6 +128,14 @@ def enable_all_roles_and_domains(): [d.name for d in domains]) add_all_roles_to('Administrator') +def set_defaults_for_tests(): + from frappe.utils.nestedset import get_root_of + + selling_settings = frappe.get_single("Selling Settings") + selling_settings.customer_group = get_root_of("Customer Group") + selling_settings.territory = get_root_of("Territory") + selling_settings.save() + def insert_record(records): for r in records: