From 9021ef75d1d8c496777eb452d043639f9b8247e4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 30 Nov 2012 19:45:51 +0530 Subject: [PATCH] minor fixes --- buying/doctype/supplier/supplier.py | 3 +-- production/doctype/bom/bom.py | 4 +--- stock/doctype/item/item.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/buying/doctype/supplier/supplier.py b/buying/doctype/supplier/supplier.py index 0e28f1fbff..63106539e5 100644 --- a/buying/doctype/supplier/supplier.py +++ b/buying/doctype/supplier/supplier.py @@ -107,8 +107,7 @@ class DocType(TransactionBase): #validation for Naming Series mandatory field... if get_defaults()['supp_master_name'] == 'Naming Series': if not self.doc.naming_series: - msgprint("Series is Mandatory.") - raise Exception + msgprint("Series is Mandatory.", raise_exception=1) def create_account_head(self): if self.doc.company : diff --git a/production/doctype/bom/bom.py b/production/doctype/bom/bom.py index a413f6a6b8..68e1c3c1b6 100644 --- a/production/doctype/bom/bom.py +++ b/production/doctype/bom/bom.py @@ -240,14 +240,12 @@ class DocType: # add operation in op list self.op.append(cstr(d.operation_no)) - - def validate_materials(self): """ Validate raw material entries """ check_list = [] for m in getlist(self.doclist, 'bom_materials'): # check if operation no not in op table - if m.operation_no not in self.op: + if cstr(m.operation_no) not in self.op: msgprint("""Operation no: %s against item: %s at row no: %s is not present at Operations table"""% (m.operation_no, m.item_code, m.idx), raise_exception = 1) diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py index 92dc82b9f8..41ae423b8f 100644 --- a/stock/doctype/item/item.py +++ b/stock/doctype/item/item.py @@ -141,7 +141,7 @@ class DocType: 'is_purchase_item' :'Is Purchase Item', 'is_pro_applicable' :'Is Pro Applicable'} for d in fl: - if cstr(self.doc.fields[d]) != 'Yes': + if cstr(self.doc.fields.get(d)) != 'Yes': self.check_for_active_boms(check = fl[d]) self.check_ref_rate_detail() self.fill_customer_code()