Merge lp:~credativ/openobject-addons/6.1-lp-1033731 into lp:openobject-addons/6.1

Proposed by Craig Gowing (credativ)
Status: Needs review
Proposed branch: lp:~credativ/openobject-addons/6.1-lp-1033731
Merge into: lp:openobject-addons/6.1
Diff against target: 18 lines (+7/-1)
1 file modified
stock/stock.py (+7/-1)
To merge this branch: bzr merge lp:~credativ/openobject-addons/6.1-lp-1033731
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+157292@code.launchpad.net

Description of the change

Fix for lp:1033731

To post a comment you must log in.

Unmerged revisions

7199. By Craig Gowing (credativ)

[FIX] JIT may assign stock moves immediately, so only confirm moves if they are still draft

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-10-22 09:29:02 +0000
+++ stock/stock.py 2013-04-05 07:41:24 +0000
@@ -727,7 +727,13 @@
727727
728 todo = self.action_explode(cr, uid, todo, context)728 todo = self.action_explode(cr, uid, todo, context)
729 if len(todo):729 if len(todo):
730 self.pool.get('stock.move').action_confirm(cr, uid, todo, context=context)730 # JIT may assign stock moves immediately, so only confirm
731 # moves if they are still draft
732 move_obj = self.pool.get('stock.move')
733 moves = move_obj.read(cr, uid, todo, ['id','state'], context=context)
734 to_confirm = [ m['id'] for m in moves if m['state'] == 'draft' ]
735 if len(to_confirm):
736 self.pool.get('stock.move').action_confirm(cr, uid, to_confirm, context=context)
731 return True737 return True
732738
733 def test_auto_picking(self, cr, uid, ids):739 def test_auto_picking(self, cr, uid, ids):