Merge branch 'master' of github.com:webnotes/erpnext into responsive

This commit is contained in:
Anand Doshi 2013-06-10 17:59:04 +05:30
commit f16836d75b

View File

@ -59,7 +59,7 @@ def upload():
if not company_abbr: if not company_abbr:
webnotes.msgprint(_("Company is missing or entered incorrect value"), raise_exception=1) webnotes.msgprint(_("Company is missing or entered incorrect value"), raise_exception=1)
data, start_idx = get_data(rows, company_abbr) data, start_idx = get_data(rows, company_abbr, rows[0][0])
except Exception, e: except Exception, e:
err_msg = webnotes.message_log and "<br>".join(webnotes.message_log) or cstr(e) err_msg = webnotes.message_log and "<br>".join(webnotes.message_log) or cstr(e)
messages.append("""<p style='color: red'>%s</p>""" % (err_msg or "No message")) messages.append("""<p style='color: red'>%s</p>""" % (err_msg or "No message"))
@ -213,10 +213,11 @@ def get_common_values(rows):
return common_values return common_values
def get_data(rows, company_abbr): def get_data(rows, company_abbr, import_type):
start_row = 0 start_row = 0
data = [] data = []
start_row_idx = 0 start_row_idx = 0
accounts = None
for i in xrange(len(rows)): for i in xrange(len(rows)):
r = rows[i] r = rows[i]
if r[0]: if r[0]:
@ -257,6 +258,8 @@ def get_data(rows, company_abbr):
columns = [c.replace(" ", "_").lower() for c in rows[i+1] columns = [c.replace(" ", "_").lower() for c in rows[i+1]
if not c.endswith(" - " + company_abbr)] if not c.endswith(" - " + company_abbr)]
if import_type == "Voucher Import: Multiple Accounts":
accounts = [c for c in rows[i+1] if c.endswith(" - " + company_abbr)] accounts = [c for c in rows[i+1] if c.endswith(" - " + company_abbr)]
if not accounts: if not accounts: