From c05b4451cd8781c1929d71b3a4b3504007e1f9ae Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 27 Jan 2009 01:17:53 +0100 Subject: [PATCH] bugfix_sequence bzr revid: fp@tinyerp.com-20090127001753-vnl7yfh4ve2p0y12 --- addons/account/account.py | 3 ++- addons/account/invoice.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index eb350f35a78..9c0fe9f1a48 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -460,7 +460,8 @@ class account_journal(osv.osv): 'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'), 'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want that new account moves pass through the \'draft\' state and goes direclty to the \'posted state\' without any manual validation.'), 'company_id': fields.related('default_credit_account_id','company_id',type='many2one', relation="res.company", string="Company"), - 'invoice_sequence_id': fields.many2one('ir.sequence', 'Sequence'), + 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \ + help="The sequence used for invoice numbers in this journal."), } _defaults = { diff --git a/addons/account/invoice.py b/addons/account/invoice.py index c87561d4b93..2e5550325b7 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -676,7 +676,7 @@ class account_invoice(osv.osv): if not number: if obj_inv.journal_id.invoice_sequence_id: sid = obj_inv.journal_id.invoice_sequence_id.id - number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id=%s', {'fiscalyear_id': obj.period_id.fiscalyear_id.id}) + number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id=%s', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id}) else: number = self.pool.get('ir.sequence').get(cr, uid, 'account.invoice.' + invtype)