Fixed deafault BOM problem
This commit is contained in:
parent
93416ee72c
commit
0248811e53
@ -181,15 +181,12 @@ class BOM(Document):
|
|||||||
if item.default_bom != self.name:
|
if item.default_bom != self.name:
|
||||||
item.default_bom = self.name
|
item.default_bom = self.name
|
||||||
item.save()
|
item.save()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not self.is_active:
|
frappe.db.set(self, "is_default", 0)
|
||||||
frappe.db.set(self, "is_default", 0)
|
item = frappe.get_doc("Item", self.item)
|
||||||
|
if item.default_bom == self.name:
|
||||||
item = frappe.get_doc("Item", self.item)
|
item.default_bom = None
|
||||||
if item.default_bom == self.name:
|
item.save()
|
||||||
item.default_bom = None
|
|
||||||
item.save()
|
|
||||||
|
|
||||||
def clear_operations(self):
|
def clear_operations(self):
|
||||||
if not self.with_operations:
|
if not self.with_operations:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user