From 6198c28fd352f597194c2cea460b9830b417f11f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 26 Apr 2013 17:29:05 +0530 Subject: [PATCH] validation for stock and nonstock items in purchase cycle --- manufacturing/doctype/bom/bom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manufacturing/doctype/bom/bom.py b/manufacturing/doctype/bom/bom.py index 1408a3ad5c..5f42f4da5d 100644 --- a/manufacturing/doctype/bom/bom.py +++ b/manufacturing/doctype/bom/bom.py @@ -89,7 +89,7 @@ class DocType: "qty": item.qty }) for r in ret: - if not item.fields[r]: + if not item.fields.get(r): item.fields[r] = ret[r] def get_bom_material_detail(self, args=None): @@ -117,7 +117,7 @@ class DocType: def get_rm_rate(self, arg): """ Get raw material rate as per selected method, if bom exists takes bom cost """ - + rate = 0 if arg['bom_no']: rate = self.get_bom_unitcost(arg['bom_no']) elif arg and (arg['is_purchase_item'] == 'Yes' or arg['is_sub_contracted_item'] == 'Yes'):