[fix] set default supplier group in test
diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.py b/erpnext/setup/doctype/supplier_group/supplier_group.py
index 747560a..fa265d4 100644
--- a/erpnext/setup/doctype/supplier_group/supplier_group.py
+++ b/erpnext/setup/doctype/supplier_group/supplier_group.py
@@ -4,10 +4,13 @@
from __future__ import unicode_literals
import frappe
-from frappe.utils.nestedset import NestedSet
+from frappe.utils.nestedset import NestedSet, get_root_of
class SupplierGroup(NestedSet):
nsm_parent_field = 'parent_supplier_group';
+ def validate(self):
+ if not self.parent_supplier_group:
+ self.parent_supplier_group = get_root_of("Supplier Group")
def update_nsm_model(self):
frappe.utils.nestedset.update_nsm(self)