From 72db7633b1c12cdb564c99f498765812c7bba625 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Mon, 2 Feb 2015 09:17:34 +0100 Subject: [PATCH] [FIX] account: passing ir_sequence_date in the context when calling next_by_id to replace the old behavior with fiscalyear_id in the context --- addons/account/account.py | 2 +- addons/account/account_bank_statement.py | 2 +- addons/account/account_cash_statement.py | 2 +- addons/account_voucher/account_voucher.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 87cfc302168..580cb9d7533 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1320,7 +1320,7 @@ class account_move(osv.osv): new_name = invoice.internal_number else: if journal.sequence_id: - c = {'fiscalyear_id': move.period_id.fiscalyear_id.id} + c = {'ir_sequence_date': move.period_id.date_start} new_name = obj_sequence.next_by_id(cr, uid, journal.sequence_id.id, c) else: raise UserError(_('Please define a sequence on the journal.')) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 630af63708b..6b0da3d7988 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -77,7 +77,7 @@ class account_bank_statement(osv.osv): context = dict(context or {}) obj_seq = self.pool.get('ir.sequence') period = self.pool.get('account.period').browse(cr, uid, self._get_period(cr, uid, context=context), context=context) - context['fiscalyear_id'] = period.fiscalyear_id.id + context['ir_sequence_date'] = period.date_start journal = self.pool.get('account.journal').browse(cr, uid, journal_id, None) return obj_seq.next_by_id(cr, uid, journal.sequence_id.id, context=context) diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index 78101f1b6d2..04cbbf67aab 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -272,7 +272,7 @@ class account_cash_statement(osv.osv): raise AccessError((_('You do not have rights to open this %s journal!') % (statement.journal_id.name, ))) if statement.name and statement.name == '/': - c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id} + c = {'ir_sequence_date': statement.period_id.date_start} if statement.journal_id.sequence_id: st_number = obj_seq.next_by_id(cr, uid, statement.journal_id.sequence_id.id, context=c) else: diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index d01b20ab5a7..2f99792c606 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1057,7 +1057,7 @@ class account_voucher(osv.osv): if not voucher.journal_id.sequence_id.active: raise UserError(_('Please activate the sequence of selected journal !')) c = dict(context) - c.update({'fiscalyear_id': voucher.period_id.fiscalyear_id.id}) + c.update({'ir_sequence_date': voucher.period_id.date_start}) name = seq_obj.next_by_id(cr, uid, voucher.journal_id.sequence_id.id, context=c) else: raise UserError(_('Please define a sequence on the journal.'))