mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] use a list of lines and join for efficient concatenation, reinit the msg list at the correct place
This commit is contained in:
@@ -432,9 +432,9 @@ class AccountBankSatement(Model):
|
||||
if context is None:
|
||||
context = {}
|
||||
stat_line_obj = self.pool.get('account.bank.statement.line')
|
||||
msg = ""
|
||||
compl_lines = 0
|
||||
for stat in self.browse(cr, uid, ids, context=context):
|
||||
msg_lines = []
|
||||
ctx = context.copy()
|
||||
for line in stat.line_ids:
|
||||
res = {}
|
||||
@@ -444,14 +444,15 @@ class AccountBankSatement(Model):
|
||||
if res:
|
||||
compl_lines += 1
|
||||
except ErrorTooManyPartner, exc:
|
||||
msg += repr(exc) + "\n"
|
||||
msg_lines.append(repr(exc))
|
||||
except Exception, exc:
|
||||
msg += repr(exc) + "\n"
|
||||
msg_lines.append(repr(exc))
|
||||
# vals = res and res.keys() or False
|
||||
if res:
|
||||
vals = res[line.id]
|
||||
vals['already_completed'] = True
|
||||
stat_line_obj.write(cr, uid, [line.id], vals, context=ctx)
|
||||
self.write_completion_log(
|
||||
cr, uid, stat.id, msg, compl_lines, context=context)
|
||||
msg = u'\n'.join(msg_lines)
|
||||
self.write_completion_log(cr, uid, stat.id,
|
||||
msg, compl_lines, context=context)
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user