[voucher import tool][fix] fixes for handling exception

This commit is contained in:
Nabin Hait 2013-05-28 18:16:44 +05:30
parent 58c3348ca6
commit 0dbd62f163

View File

@ -54,10 +54,11 @@ def upload():
rows = read_csv_content_from_uploaded_file()
common_values = get_common_values(rows)
if not common_values.company:
webnotes.msgprint(_("Company is missing in csv file"), raise_exception=1)
company_abbr = webnotes.conn.get_value("Company", common_values.company, "abbr")
if not company_abbr:
webnotes.msgprint(_("Company is missing or entered incorrect value"), raise_exception=1)
data, start_idx = get_data(rows, company_abbr)
except Exception, e:
err_msg = webnotes.message_log and "<br>".join(webnotes.message_log) or cstr(e)