From 4d22ce96d12c7b723a35afe8f72bcf81479e49e5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 23 Jan 2012 14:51:00 +0530 Subject: [PATCH] Fix: is_default of BOM --- .../production/doctype/bill_of_materials/bill_of_materials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py index 2a17817555..6e99af94d7 100644 --- a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py +++ b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py @@ -135,7 +135,7 @@ class DocType: """ Uncheck others if current one is selected as default, update default bom in item master""" if self.doc.is_default and self.doc.is_active == 'Yes': - sql("update `tabBill Of Materials` set is_default = 0 where name != %s", self.doc.name) + sql("update `tabBill Of Materials` set is_default = 0 where name != %s and item=%s", (self.doc.name, self.doc.item)) # update default bom in Item Master sql("update `tabItem` set default_bom = %s where name = %s", (self.doc.name, self.doc.item))