From 396d424ab4841190c1a782c10bc9de56b584cf27 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 9 Nov 2012 12:09:01 +0530 Subject: [PATCH] fixes in stock reco cancellation --- .../doctype/stock_reconciliation/stock_reconciliation.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.py b/stock/doctype/stock_reconciliation/stock_reconciliation.py index 74a439f5c2..28a1271cdb 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -49,14 +49,15 @@ class DocType: return data - def convert_into_list(self, data, submit = 1): + def convert_into_list(self, data, submit=1): """Convert csv data into list""" count = 1 for s in data: count += 1 - if count == 2: - if s[0] != 'Item Code' or s[1] != 'Warehouse': - msgprint("First row of the attachment always should be same as template(Item Code, Warehouse, Quantity \ + if count == 2 and submit: + if cstr(s[0]).strip() != 'Item Code' or cstr(s[1]).strip() != 'Warehouse': + msgprint("First row of the attachment always should be same as \ + template(Item Code, Warehouse, Quantity \ and Valuation Rate/Incoming Rate)", raise_exception=1) else: continue