mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] Add the number of lines in completion log to let the user know if some hasn't been auto-completed (e.g. 332/335 line compelted)
This commit is contained in:
@@ -496,18 +496,21 @@ class AccountBankStatement(orm.Model):
|
|||||||
"""
|
"""
|
||||||
user_name = self.pool.get('res.users').read(cr, uid, uid,
|
user_name = self.pool.get('res.users').read(cr, uid, uid,
|
||||||
['name'], context=context)['name']
|
['name'], context=context)['name']
|
||||||
|
statement = self.browse(cr, uid, stat_id, context=context)
|
||||||
|
number_line = len(statement.line_ids)
|
||||||
|
|
||||||
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 = log if log else ""
|
log = log if log else ""
|
||||||
|
|
||||||
completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
message = (_("%s Bank Statement ID %s has %s lines completed by %s \n%s\n%s\n") %
|
message = (_("%s Bank Statement ID %s has %s/%s lines completed by %s \n%s\n%s\n") %
|
||||||
(completion_date, stat_id, number_imported, user_name, error_msg, log))
|
(completion_date, stat_id, number_imported, number_line, user_name,
|
||||||
|
error_msg, log))
|
||||||
self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)
|
self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)
|
||||||
|
|
||||||
body = (_('Statement ID %s auto-completed for %s lines completed') %
|
body = (_('Statement ID %s auto-completed for %s/%s lines completed') %
|
||||||
(stat_id, number_imported)),
|
(stat_id, number_imported, number_line)),
|
||||||
self.message_post(cr, uid,
|
self.message_post(cr, uid,
|
||||||
[stat_id],
|
[stat_id],
|
||||||
body=body,
|
body=body,
|
||||||
|
|||||||
Reference in New Issue
Block a user