[fix] set default supplier group in test

This commit is contained in:
Rushabh Mehta 2018-05-16 13:57:16 +05:30
parent 8788688431
commit f7414519bb

View File

@ -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)