From e477f5a8e18edec30481200c611f56b1aa37e06c Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 1 Jan 2015 15:02:56 +0100 Subject: [PATCH] [FIX] Bug #119 account_auto_fy_sequence now works well with the POS --- account_auto_fy_sequence/models/ir_sequence.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_auto_fy_sequence/models/ir_sequence.py b/account_auto_fy_sequence/models/ir_sequence.py index 06525160c..2591739db 100644 --- a/account_auto_fy_sequence/models/ir_sequence.py +++ b/account_auto_fy_sequence/models/ir_sequence.py @@ -26,6 +26,8 @@ from openerp.osv import orm from openerp import SUPERUSER_ID from openerp.tools.translate import _ +from openerp import api + FY_SLOT = '%(fy)s' YEAR_SLOT = '%(year)s' @@ -62,6 +64,12 @@ class Sequence(orm.Model): }, context=context) return fy_seq_id + # We NEED to have @api.cr_uid_ids_context even if this file still uses + # the old API, to avoid breaking the POS, see this bug: + # https://github.com/OCA/account-financial-tools/issues/119 + # Don't ask me why it fixes the bug, I have no idea -- Alexis de Lattre + # I "copied" this solution from odoo-80/addons/account/ir_sequence.py + @api.cr_uid_ids_context def _next(self, cr, uid, seq_ids, context=None): if context is None: context = {}