From fff3eb414230319d73192143bf9b2c5dc82db2d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 18 Dec 2012 14:57:49 +0530 Subject: [PATCH] Update production/doctype/bom/bom.py set is_default in current BOM when updating after submit --- production/doctype/bom/bom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/production/doctype/bom/bom.py b/production/doctype/bom/bom.py index ac21d21378..af0a7dd0e1 100644 --- a/production/doctype/bom/bom.py +++ b/production/doctype/bom/bom.py @@ -149,7 +149,8 @@ class DocType: def manage_default_bom(self): """ 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': sql("update `tabBOM` set is_default = 0 where name != %s and item=%s", (self.doc.name, self.doc.item))