~unifield-team/unifield-addons/UTP-594

« back to all changes in this revision

Viewing changes to account/test/account_customer_invoice.yml

  • Committer: jf
  • Date: 2014-01-02 22:42:51 UTC
  • mfrom: (4601.1.2 unifield-addons)
  • Revision ID: jf@ubuntu-20140102224251-2kz3edurb9sk15g9
[FIX] Unit test on Jan period / register

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
  !python {model: account.period}: |
25
25
    import datetime
26
26
    period_ids = self.search(cr, uid, [], order='date_start, name')
 
27
    # close the register created by the minimal account
 
28
    bks_obj = self.pool.get('account.bank.statement')
 
29
    reg_ids = self.pool.get('account.bank.statement').search(cr, uid, [])
 
30
    if reg_ids:
 
31
        bks_obj.write(cr, uid, reg_ids, {'state': 'confirm'})
27
32
    for p in self.browse(cr, uid, period_ids):
28
33
      self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
29
 
      self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
 
34
    self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
30
35
-
31
36
  I check that Initially customer invoice is in the "Draft" state
32
37
-