From ab6848d37b619bf38703daf8bf350bbd61714563 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 27 Nov 2012 18:33:39 +0530 Subject: [PATCH] if bom is cancelled, mark it as inactive and uncheck default. also unset it in item --- production/doctype/bom/bom.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/production/doctype/bom/bom.py b/production/doctype/bom/bom.py index 69b6de4c04..913e7b6638 100644 --- a/production/doctype/bom/bom.py +++ b/production/doctype/bom/bom.py @@ -398,3 +398,7 @@ class DocType: if par: msgprint("BOM can not be cancelled, as it is a child item in following active BOM %s"% [d[0] for d in par]) raise Exception + + webnotes.conn.set(self.doc, "is_active", "No") + webnotes.conn.set(self.doc, "is_default", 0) + self.manage_default_bom()