Cancelling a procurement always makes a stock move available

Bug #1290509 reported by David Leach on 2014-03-10
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
Unassigned
7.0
Fix Committed
Undecided
OpenERP Publisher's Warranty Team

Bug Description

When a procurement order is cancelled (manually or by cancelling a draft Make to Order PO), any corresponding stock move 'waiting another move' gets automatically set to 'available', regardless of current stock level. Instead, it should set the product to 'waiting availability', and immediately try to reserve from stock (same result, unless there is not enough stock on hand).

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.
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.

The current behavior causes two problems:

1.) In the case where we cancel a draft MTO PO, and do not have have the goods on hand, the status of 'available' is very misleading.
2.) Since the action_cancel() function just changes the state of the stock move without triggering any workflows/functions of the parent picking, an internal move can get stuck in 'waiting availability' when all of its moves are available.

Related branches

David Leach (david-leach) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance

Hello David,

Thanks for the contribution.
This issue is fixed with following:
branch: lp:~openerp-dev/openobject-addons/7.0-opw-605091-ado
revision-id: <email address hidden>
revision-no: 9920

Soon our experts will review and merge it with stable 7.0 addons.

Regards,
Amit

Changed in openobject-addons:
assignee: OpenERP Publisher's Warranty Team (openerp-opw) → nobody

Hello,

Thanks for the report and patch, it was merged in 7.0

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

Changed in openobject-addons:
status: New → Fix Released
importance: Undecided → Low
Changed in openobject-addons:
milestone: none → 7.0
Yann Papouin (yann-papouin) wrote :

If the procurement is canceled, then the remaining stock move will stay in the 'confirmed' state if there is not enough quantity.
The scheduler will never try to 'assigned' them.

The solution is maybe to create a new procurement linked to the existing move with a 'make_to_stock' procure_method. That way the scheduler will make it's job.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers