[FIX] account_voucher: improvement for number in voucher
authorRifakat (OpenERP) <rha@tinyerp.com>
Mon, 5 Mar 2012 12:16:15 +0000 (17:46 +0530)
committerRifakat (OpenERP) <rha@tinyerp.com>
Mon, 5 Mar 2012 12:16:15 +0000 (17:46 +0530)
bzr revid: rha@tinyerp.com-20120305121615-ljcrlgh0xww63dug

1  2 
addons/account_voucher/account_voucher.py

@@@ -596,7 -612,9 +596,8 @@@ class account_voucher(osv.osv)
          res = {
              'state':'cancel',
              'move_id':False,
++            'number': ''
          }
 -        if invoice_ids:
 -            wf_service.trg_validate(uid, 'account.invoice', invoice_ids[0], 'open_test', cr)
          self.write(cr, uid, ids, res)
          return True
  
                  continue
              context_multi_currency = context.copy()
              context_multi_currency.update({'date': inv.date})
--
--            if inv.number:
--                name = inv.number
--            elif inv.journal_id.sequence_id:
++            
++            if inv.journal_id.sequence_id:
                  name = seq_obj.get_id(cr, uid, inv.journal_id.sequence_id.id)
              if not name:
                  raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal and make sure it is activated !'))