minor fixes

This commit is contained in:
Anand Doshi 2012-11-30 19:45:51 +05:30
parent d8b85073cd
commit 9021ef75d1
3 changed files with 3 additions and 6 deletions

View File

@ -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 :

View File

@ -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)

View File

@ -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()