~camptocamp/banking-addons/bank-statement-reconcile-7.0-improv-controlling-jge

« back to all changes in this revision

Viewing changes to account_statement_base_completion/statement.py

  • Committer: Yannick Vaucher
  • Author(s): joel.grandguillaume at camptocamp
  • Date: 2014-03-14 10:50:40 UTC
  • Revision ID: yannick.vaucher@camptocamp.com-20140314105040-kvmw6x6bpif4m1hp
[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)

Show diffs side-by-side

added added

removed removed

Lines of Context:
496
496
        """
497
497
        user_name = self.pool.get('res.users').read(cr, uid, uid,
498
498
                                                    ['name'], context=context)['name']
 
499
        statement = self.browse(cr, uid, stat_id, context=context)
 
500
        number_line = len(statement.line_ids)
499
501
 
500
502
        log = self.read(cr, uid, stat_id, ['completion_logs'],
501
503
                        context=context)['completion_logs']
502
504
        log = log if log else ""
503
505
 
504
506
        completion_date = datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
505
 
        message = (_("%s Bank Statement ID %s has %s lines completed by %s \n%s\n%s\n") %
506
 
                   (completion_date, stat_id, number_imported, user_name, error_msg, log))
 
507
        message = (_("%s Bank Statement ID %s has %s/%s lines completed by %s \n%s\n%s\n") %
 
508
                   (completion_date, stat_id, number_imported, number_line, user_name, 
 
509
                    error_msg, log))
507
510
        self.write(cr, uid, [stat_id], {'completion_logs': message}, context=context)
508
511
 
509
 
        body = (_('Statement ID %s auto-completed for %s lines completed') %
510
 
                (stat_id, number_imported)),
 
512
        body = (_('Statement ID %s auto-completed for %s/%s lines completed') %
 
513
                (stat_id, number_imported, number_line)),
511
514
        self.message_post(cr, uid,
512
515
                          [stat_id],
513
516
                          body=body,