[???] pass context in post_method(override in cci_account)
authornel@tinyerp.com <>
Fri, 16 Jul 2010 12:54:48 +0000 (14:54 +0200)
committernel@tinyerp.com <>
Fri, 16 Jul 2010 12:54:48 +0000 (14:54 +0200)
bzr revid: nel@tinyerp.com-20100716125448-t83irqjn0zruv2ki

addons/account/invoice.py

index d2a0679..c6420ea 100644 (file)
@@ -715,7 +715,9 @@ class account_invoice(osv.osv):
             new_move_name = self.pool.get('account.move').browse(cr, uid, move_id).name
             # 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})
-            self.pool.get('account.move').post(cr, uid, [move_id])
+            # 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:
+            self.pool.get('account.move').post(cr, uid, [move_id], context={'invoice':inv})
         self._log_event(cr, uid, ids)
         return True