[FIX]account : when you set option Skip Draft State for Manual Entries on sale journa...
authorSomesh Khare(OpenERP) <>
Mon, 5 Nov 2012 13:28:52 +0000 (18:58 +0530)
committerMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Mon, 5 Nov 2012 13:28:52 +0000 (18:58 +0530)
bzr revid: mma@tinyerp.com-20121105132852-fh2d5qvflqpnoseg

addons/account/account_invoice.py

index b01fc97..b37118c 100644 (file)
@@ -983,13 +983,13 @@ class account_invoice(osv.osv):
                 for i in line:
                     i[2]['period_id'] = period_id
 
+            ctx.update(invoice=inv)
             move_id = move_obj.create(cr, uid, move, context=ctx)
             new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).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}, context=ctx)
             # 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:
-            ctx.update({'invoice':inv})
             move_obj.post(cr, uid, [move_id], context=ctx)
         self._log_event(cr, uid, ids)
         return True