Merge lp:~serpentcs/openobject-addons/fix-1319281-stock into lp:openobject-addons/7.0

Proposed by Serpent Consulting Services
Status: Needs review
Proposed branch: lp:~serpentcs/openobject-addons/fix-1319281-stock
Merge into: lp:openobject-addons/7.0
Diff against target: 15 lines (+3/-2)
1 file modified
stock/wizard/stock_return_picking.py (+3/-2)
To merge this branch: bzr merge lp:~serpentcs/openobject-addons/fix-1319281-stock
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+222828@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

10066. By Serpent Consulting Services

[FIX] stock : when doing a return, only DONE moves should be considered

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/wizard/stock_return_picking.py'
2--- stock/wizard/stock_return_picking.py 2013-09-09 15:25:01 +0000
3+++ stock/wizard/stock_return_picking.py 2014-06-11 15:36:38 +0000
4@@ -73,8 +73,9 @@
5 res.update({'invoice_state': '2binvoiced'})
6 else:
7 res.update({'invoice_state': 'none'})
8- return_history = self.get_return_history(cr, uid, record_id, context)
9- for line in pick.move_lines:
10+ return_history = self.get_return_history(cr, uid, record_id, context)
11+ LINES = [x for x in pick.move_lines if x.state == 'done']
12+ for line in LINES:
13 qty = line.product_qty - return_history.get(line.id, 0)
14 if qty > 0:
15 result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id, 'prodlot_id': line.prodlot_id and line.prodlot_id.id or False})