mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
Update production/doctype/bom/bom.py
set is_default in current BOM when updating after submit
This commit is contained in:
@@ -149,6 +149,7 @@ class DocType:
|
|||||||
|
|
||||||
def manage_default_bom(self):
|
def manage_default_bom(self):
|
||||||
""" Uncheck others if current one is selected as default, update default bom in item master"""
|
""" Uncheck others if current one is selected as default, update default bom in item master"""
|
||||||
|
webnotes.conn.set(self.doc, "is_default", cint(self.doc.is_default))
|
||||||
|
|
||||||
if self.doc.is_default and self.doc.is_active == 'Yes':
|
if self.doc.is_default and self.doc.is_active == 'Yes':
|
||||||
sql("update `tabBOM` set is_default = 0 where name != %s and item=%s", (self.doc.name, self.doc.item))
|
sql("update `tabBOM` set is_default = 0 where name != %s and item=%s", (self.doc.name, self.doc.item))
|
||||||
|
|||||||
Reference in New Issue
Block a user