Merge lp:~openerp-dev/openobject-addons/7.0-opw-605091-ado into lp:openobject-addons/7.0

Proposed by Amit Dodiya (OpenERP)
Status: Merged
Merged at revision: 9939
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-605091-ado
Merge into: lp:openobject-addons/7.0
Diff against target: 13 lines (+2/-1)
1 file modified
procurement/procurement.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-605091-ado
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Approve
Naresh(OpenERP) Pending
Review via email: mp+212352@code.launchpad.net

Description of the change

Hello,

[FIX] stock: while cancelling purcahse order created from procurement it availables the related internal stock move which should not and also not triggering the workflow method

Steps to reproduce:
1.) Create product A (type = stockable product, procure method = make to order, supply method = buy, qty on hand = 0)
2.) Create product B(type = stockable product, procure method = make to order, supply method = manufacture, qty on hand = 0)
3.) Set a BoM on product B, which contains product A.
4.) Create a sale order for product B, and run the procurement for both A & B product
5.) The internal move for the resulting manufacturing order should have a line for product A in 'waiting another move' status, and a draft PO for product A should have been created.
6.) Now cancel that draft PO and view the internal move again. The line for product A is 'available', even though we have 0 on hand, it should not be in available state.

For more reference please refer bug: https://bugs.launchpad.net/openobject-addons/+bug/1290509

Regards,
Amit

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

LGTM, thanks

revno: 9939 [merge]
revision-id: <email address hidden>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'procurement/procurement.py'
2--- procurement/procurement.py 2013-11-12 15:17:47 +0000
3+++ procurement/procurement.py 2014-03-24 07:03:51 +0000
4@@ -441,7 +441,8 @@
5 if len(to_cancel):
6 move_obj.action_cancel(cr, uid, to_cancel)
7 if len(to_assign):
8- move_obj.write(cr, uid, to_assign, {'state': 'assigned'})
9+ move_obj.write(cr, uid, to_assign, {'state': 'confirmed'})
10+ move_obj.action_assign(cr, uid, to_assign)
11 self.write(cr, uid, ids, {'state': 'cancel'})
12 wf_service = netsvc.LocalService("workflow")
13 for id in ids: