summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2011-10-01 01:36:30 +0200
committerAntony Lesuisse <al@openerp.com>2011-10-01 01:36:30 +0200
commitee70781dbeaa3021162b22f60cb43c3cf55b80d8 (patch)
tree3f05d5522914c7add5a4e0f32986f75f2010fbbf /addons
parentf734d04490566332c232f7d9fda4b471600aba58 (diff)
[IMP] account ir_sequence fiscal year using the new _next api
bzr revid: al@openerp.com-20110930233630-c8pbenf99yaekt3t
Diffstat (limited to 'addons')
-rw-r--r--addons/account/sequence.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/addons/account/sequence.py b/addons/account/sequence.py
index e31b09aeb67..5c9039e43c3 100644
--- a/addons/account/sequence.py
+++ b/addons/account/sequence.py
@@ -47,18 +47,12 @@ class ir_sequence(osv.osv):
'sequence_main_id', 'Sequences')
}
- def _select_by_code_or_id(self, cr, uid, sequence_code_or_id, code_or_id,
- for_update_no_wait, context=None):
- res = super(ir_sequence, self)._select_by_code_or_id(cr, uid,
- sequence_code_or_id, code_or_id, False, context)
- if not res:
- return
- for line in self.browse(cr, uid, res['id'], context).fiscal_ids:
- if line.fiscalyear_id.id == context.get('fiscalyear_id'):
- return super(ir_sequence, self)._select_by_code_or_id(cr, uid,
- line.sequence_id.id, 'id', False, context)
- return super(ir_sequence, self)._select_by_code_or_id(cr, uid,
- res['id'], 'id', False, context)
+ def _next(self, cr, uid, seq_ids, context=None):
+ for seq in self.browse(cr, uid, seq_ids, context):
+ for line in seq.fiscal_ids:
+ if line.fiscalyear_id.id == context.get('fiscalyear_id'):
+ return super(ir_sequence, self)._next(cr, uid, [line.sequence_id.id], context)
+ return super(ir_sequence, self)._next(cr, uid, seq_ids, context)
ir_sequence()