[MERGE] fix when cancelling and posting invoice again with ref numbers
bzr revid: fp@tinyerp.com-20121112100915-vncsox9ybz67iai3
This commit is contained in:
commit
9f13d25dbd
|
@ -983,13 +983,13 @@ class account_invoice(osv.osv):
|
||||||
for i in line:
|
for i in line:
|
||||||
i[2]['period_id'] = period_id
|
i[2]['period_id'] = period_id
|
||||||
|
|
||||||
|
ctx.update(invoice=inv)
|
||||||
move_id = move_obj.create(cr, uid, move, context=ctx)
|
move_id = move_obj.create(cr, uid, move, context=ctx)
|
||||||
new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name
|
new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name
|
||||||
# make the invoice point to that move
|
# make the invoice point to that move
|
||||||
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
|
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
|
||||||
# Pass invoice in context in method post: used if you want to get the same
|
# Pass invoice in context in method post: used if you want to get the same
|
||||||
# account move reference when creating the same invoice after a cancelled one:
|
# account move reference when creating the same invoice after a cancelled one:
|
||||||
ctx.update({'invoice':inv})
|
|
||||||
move_obj.post(cr, uid, [move_id], context=ctx)
|
move_obj.post(cr, uid, [move_id], context=ctx)
|
||||||
self._log_event(cr, uid, ids)
|
self._log_event(cr, uid, ids)
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue