Merge lp:~numerigraphe/openobject-addons/6.0-sale-exception-duplicate-moves into lp:openobject-addons/6.0

Proposed by Numérigraphe
Status: Needs review
Proposed branch: lp:~numerigraphe/openobject-addons/6.0-sale-exception-duplicate-moves
Merge into: lp:openobject-addons/6.0
Diff against target: 14 lines (+4/-0)
1 file modified
sale/sale.py (+4/-0)
To merge this branch: bzr merge lp:~numerigraphe/openobject-addons/6.0-sale-exception-duplicate-moves
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+134065@code.launchpad.net

Description of the change

This fixes a bug that duplicates Stock Moves when a Sale Order is in the state "Shipping Exception".
Lionel Sausin.

To post a comment you must log in.

Unmerged revisions

4333. By Anil Kesariya(SerpentCs), Lionel Sausin (Numérigraphe)

[FIX] recreate packing duplicates confirmed moves on sale exception

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/sale.py'
2--- sale/sale.py 2012-06-29 14:14:29 +0000
3+++ sale/sale.py 2012-11-13 10:13:23 +0000
4@@ -670,6 +670,10 @@
5
6 if line.state == 'done':
7 continue
8+ # If the Sale Order Line already has Stock Moves, skip it if no moves were cancelled
9+ if line.move_ids and all(
10+ [m.state != 'cancel' for m in line.move_ids]):
11+ continue
12 move_id = False
13 if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'):
14 location_id = order.shop_id.warehouse_id.lot_stock_id.id