fixes in voucher import tool

This commit is contained in:
Nabin Hait 2013-02-06 18:42:26 +05:30
parent b5bc99376e
commit e343ac7173
2 changed files with 4 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class DocType(AccountsController):
self.doc.posting_date, 'Posting Date')
self.set_against_account()
self.create_remarks()
self.create_remarks()
self.set_aging_date()
self.set_print_format_fields()
@ -152,6 +152,8 @@ class DocType(AccountsController):
if r:
self.doc.remark = ("\n").join(r)
else:
webnotes.msgprint("Remarks is mandatory", raise_exception=1)
def set_aging_date(self):
if self.doc.is_opening != 'Yes':

View File

@ -168,7 +168,7 @@ def import_vouchers(common_values, data, start_idx, import_type):
webnotes.conn.commit()
except Exception, e:
webnotes.conn.rollback()
err_msg = webnotes.message_log and webnotes.message_log[0] or unicode(e)
err_msg = webnotes.message_log and "<br>".join(webnotes.message_log) or unicode(e)
messages.append("""<p style='color: red'>[row #%s] %s failed: %s</p>"""
% ((start_idx + 1) + i, jv.name or "", err_msg or "No message"))
messages.append("<p style='color: red'>All transactions rolled back</p>")