Merge lp:~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves into lp:ocb-addons/6.1

Proposed by Yann Papouin
Status: Merged
Merged at revision: 6830
Proposed branch: lp:~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves
Merge into: lp:ocb-addons/6.1
Diff against target: 25 lines (+5/-4)
1 file modified
stock/wizard/stock_return_picking.py (+5/-4)
To merge this branch: bzr merge lp:~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves
Reviewer Review Type Date Requested Status
Sandy Carter (http://www.savoirfairelinux.com) code review, pep8 Needs Fixing
Yannick Vaucher @ Camptocamp code review, no test Approve
Holger Brunn (Therp) code review Approve
Review via email: mp+197753@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

lines 8ff differ from the fix proposed against, but that's a good thing in my opinion

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

forward port of bug fix in 6.1

Thanks

review: Approve (code review, no test)
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

PEP8:
l.11 W603 '<>' is deprecated, use '!='
l.14 E231 missing whitespace after ','
l.14 E231 missing whitespace after ':'

review: Needs Fixing (code review, pep8)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Missed the target with my comment :/

Already merged

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-12-02 12:17:08 +0000
3+++ stock/wizard/stock_return_picking.py 2013-12-04 16:35:49 +0000
4@@ -72,9 +72,10 @@
5 res.update({'invoice_state': 'none'})
6 return_history = self.get_return_history(cr, uid, record_id, context)
7 for line in pick.move_lines:
8- qty = line.product_qty - return_history[line.id]
9- if qty > 0:
10- result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id})
11+ if line.state <> 'cancel':
12+ qty = line.product_qty - return_history[line.id]
13+ if qty > 0:
14+ result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id})
15 if 'product_return_moves' in fields:
16 res.update({'product_return_moves': result1})
17 return res
18@@ -128,7 +129,7 @@
19 # a valid return move will be the exact opposite of ours:
20 # (src location, dest location) <=> (dest location, src location))
21 if rec.location_dest_id.id == m.location_id.id \
22- and rec.location_id.id == m.location_dest_id.id:
23+ and rec.location_id.id == m.location_dest_id.id and rec.state != 'cancel':
24 return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
25 return return_history
26

Subscribers

People subscribed via source and target branches