[FIX] Pass context to ir.sequence.next_by*
lp bug: https://launchpad.net/bugs/974355 fixed bzr revid: stefan@therp.nl-20120314125324-g1kbltrcygxlmcgt
This commit is contained in:
commit
94896a9c0b
|
@ -1652,7 +1652,7 @@ class account_move_reconcile(osv.osv):
|
|||
'create_date': fields.date('Creation date', readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
|
||||
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile', ctx) or '/',
|
||||
}
|
||||
|
||||
def reconcile_partial_check(self, cr, uid, ids, type='auto', context=None):
|
||||
|
|
|
@ -345,7 +345,7 @@ class account_bank_statement(osv.osv):
|
|||
c = {'fiscalyear_id': st.period_id.fiscalyear_id.id}
|
||||
st_number = obj_seq.next_by_id(cr, uid, st.journal_id.sequence_id.id, context=c)
|
||||
else:
|
||||
st_number = obj_seq.next_by_code(cr, uid, 'account.bank.statement')
|
||||
st_number = obj_seq.next_by_code(cr, uid, 'account.bank.statement', context=c)
|
||||
|
||||
for line in st.move_line_ids:
|
||||
if line.state <> 'valid':
|
||||
|
|
|
@ -296,7 +296,7 @@ class account_cash_statement(osv.osv):
|
|||
c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id}
|
||||
st_number = obj_seq.next_by_id(cr, uid, statement.journal_id.sequence_id.id, context=c)
|
||||
else:
|
||||
st_number = obj_seq.next_by_code(cr, uid, 'account.cash.statement')
|
||||
st_number = obj_seq.next_by_code(cr, uid, 'account.cash.statement', context=c)
|
||||
vals.update({
|
||||
'name': st_number
|
||||
})
|
||||
|
|
|
@ -889,7 +889,7 @@ class account_voucher(osv.osv):
|
|||
if voucher_brw.number:
|
||||
name = voucher_brw.number
|
||||
elif voucher_brw.journal_id.sequence_id:
|
||||
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id)
|
||||
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_('Please define a sequence on the journal !'))
|
||||
|
|
|
@ -52,9 +52,9 @@ class pos_open_statement(osv.osv_memory):
|
|||
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], context=context)
|
||||
|
||||
if journal.sequence_id:
|
||||
number = sequence_obj.next_by_id(cr, uid, journal.sequence_id.id)
|
||||
number = sequence_obj.next_by_id(cr, uid, journal.sequence_id.id, context=context)
|
||||
else:
|
||||
number = sequence_obj.next_by_code(cr, uid, 'account.cash.statement')
|
||||
number = sequence_obj.next_by_code(cr, uid, 'account.cash.statement', context=context)
|
||||
|
||||
data.update({
|
||||
'journal_id': journal.id,
|
||||
|
|
Loading…
Reference in New Issue