[IMP] log code cleanup

This commit is contained in:
unknown
2013-04-25 09:33:11 +02:00
parent 39484b4a96
commit 5395c25beb

View File

@@ -445,15 +445,12 @@ class AccountBankSatement(orm.Model):
log = self.read(cr, uid, stat_id, ['completion_logs'], log = self.read(cr, uid, stat_id, ['completion_logs'],
context=context)['completion_logs'] context=context)['completion_logs']
log_line = log and log.split("\n") or []
completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT) completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
if error_msg: if error_msg:
error_log = error_msg error_log = error_msg
log_line[0:0] = [completion_date + ' : ' message = (_(u"%s Bank Statement ID %s has %s lines completed by %s \n%s\n") %
+ _("Bank Statement ID %s has %s lines completed by %s") % (completion_date, stat_id, number_imported, user_name, error_log))
(stat_id, number_imported, user_name) log = message + log
+ "\n" + error_log + "-------------" + "\n"]
log = "\n".join(log_line)
self.write(cr, uid, [stat_id], {'completion_logs': log}, context=context) self.write(cr, uid, [stat_id], {'completion_logs': log}, context=context)
body = (_('Statement ID %s auto-completed for %s lines completed') % body = (_('Statement ID %s auto-completed for %s lines completed') %