[fix] set default supplier group in test
This commit is contained in:
parent
8788688431
commit
f7414519bb
@ -4,10 +4,13 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.utils.nestedset import NestedSet
|
from frappe.utils.nestedset import NestedSet, get_root_of
|
||||||
|
|
||||||
class SupplierGroup(NestedSet):
|
class SupplierGroup(NestedSet):
|
||||||
nsm_parent_field = 'parent_supplier_group';
|
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):
|
def update_nsm_model(self):
|
||||||
frappe.utils.nestedset.update_nsm(self)
|
frappe.utils.nestedset.update_nsm(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user