[IMP] ir_sequence: call it with the new methods.
bzr revid: vmt@openerp.com-20110929132254-eevlq6t9d6i6um7z
This commit is contained in:
parent
6c90db2dde
commit
bd341cc6fe
|
@ -1214,7 +1214,7 @@ class account_move(osv.osv):
|
|||
else:
|
||||
if journal.sequence_id:
|
||||
c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
|
||||
new_name = obj_sequence.get_id(cr, uid, journal.sequence_id.id, context=c)
|
||||
new_name = obj_sequence.next_by_id(cr, uid, journal.sequence_id.id, c)
|
||||
else:
|
||||
raise osv.except_osv(_('Error'), _('No sequence defined on the journal !'))
|
||||
|
||||
|
|
|
@ -340,9 +340,9 @@ class account_bank_statement(osv.osv):
|
|||
else:
|
||||
if st.journal_id.sequence_id:
|
||||
c = {'fiscalyear_id': st.period_id.fiscalyear_id.id}
|
||||
st_number = obj_seq.get_id(cr, uid, st.journal_id.sequence_id.id, context=c)
|
||||
st_number = obj_seq.next_by_id(cr, uid, st.journal_id.sequence_id.id, context=c)
|
||||
else:
|
||||
st_number = obj_seq.get(cr, uid, 'account.bank.statement')
|
||||
st_number = obj_seq.next_by_code(cr, uid, 'account.bank.statement')
|
||||
|
||||
for line in st.move_line_ids:
|
||||
if line.state <> 'valid':
|
||||
|
|
|
@ -294,9 +294,9 @@ class account_cash_statement(osv.osv):
|
|||
if statement.name and statement.name == '/':
|
||||
if statement.journal_id.sequence_id:
|
||||
c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id}
|
||||
st_number = obj_seq.get_id(cr, uid, statement.journal_id.sequence_id.id, context=c)
|
||||
st_number = obj_seq.next_by_id(cr, uid, statement.journal_id.sequence_id.id, context=c)
|
||||
else:
|
||||
st_number = obj_seq.get(cr, uid, 'account.cash.statement')
|
||||
st_number = obj_seq.next_by_code(cr, uid, 'account.cash.statement')
|
||||
vals.update({
|
||||
'name': st_number
|
||||
})
|
||||
|
|
|
@ -1221,7 +1221,7 @@ class account_move_line(osv.osv):
|
|||
vals['move_id'] = res[0]
|
||||
if not vals.get('move_id', False):
|
||||
if journal.sequence_id:
|
||||
#name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
|
||||
#name = self.pool.get('ir.sequence').next_by_id(cr, uid, journal.sequence_id.id)
|
||||
v = {
|
||||
'date': vals.get('date', time.strftime('%Y-%m-%d')),
|
||||
'period_id': context['period_id'],
|
||||
|
|
|
@ -35,7 +35,7 @@ class account_move(osv.osv):
|
|||
seq_no = False
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
if move.journal_id.internal_sequence_id:
|
||||
seq_no = obj_sequence.get_id(cr, uid, move.journal_id.internal_sequence_id.id, context=context)
|
||||
seq_no = obj_sequence.next_by_id(cr, uid, move.journal_id.internal_sequence_id.id, context=context)
|
||||
if seq_no:
|
||||
self.write(cr, uid, [move.id], {'internal_sequence_number': seq_no})
|
||||
return res
|
||||
|
|
|
@ -674,7 +674,7 @@ class account_voucher(osv.osv):
|
|||
if inv.number:
|
||||
name = inv.number
|
||||
elif inv.journal_id.sequence_id:
|
||||
name = seq_obj.get_id(cr, uid, inv.journal_id.sequence_id.id)
|
||||
name = seq_obj.next_by_id(cr, uid, inv.journal_id.sequence_id.id)
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal !'))
|
||||
if not inv.reference:
|
||||
|
|
|
@ -53,9 +53,9 @@ class pos_open_statement(osv.osv_memory):
|
|||
continue
|
||||
|
||||
if journal.sequence_id:
|
||||
number = sequence_obj.get_id(cr, uid, journal.sequence_id.id)
|
||||
number = sequence_obj.next_by_id(cr, uid, journal.sequence_id.id)
|
||||
else:
|
||||
number = sequence_obj.get(cr, uid, 'account.cash.statement')
|
||||
number = sequence_obj.next_by_code(cr, uid, 'account.cash.statement')
|
||||
|
||||
data.update({
|
||||
'journal_id': journal.id,
|
||||
|
|
Loading…
Reference in New Issue