purchase_requisition: procurement is cancelled when first PO is cancelled

Bug #891616 reported by Régis C.
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Low
OpenERP Publisher's Warranty Team

Bug Description

Steps to reproduce the issue:
0) Create product X, make to order, purchase requisition checked, 2 suppliers (supplier1, supplier2)
1) Confirm sale order for one X
2) Run scheduler => a requisition with one PO for supplier1 is created
3) Open requisition, select exclusive type and add a PO for supplier2
4) Confirm supplier2 PO

Observed result:
First PO is cancelled and procurement is cancelled

Expected result:
First PO is cancelled and procurement is running

OpenERP version: 6.0.3

I don't find in the code where this cancellation occurs. Even if I remove "visible" links between the procurement and the first PO (procurement_order.purchase_id and purchase_order_line.move_dest_id), the procurement is cancelled.

The state of procurement's stock move doesn't change (keeps unavailable), it's OK, but the Suppliers->Stock move hasn't move_dest_id filled (consequence of the bug ?).
So, the procurement and the moves chain are broken.

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello ,

I am confirming this issue at my end.

It working fine with Trunk so I am assign this
issue to OPW Team

Thanks.

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Régis C. (reg53fr) wrote :

Hello Jignesh,

I've tested with fresh trunk today and the problem is still here :(

The issue doesn't directly come from purchase_requisition : if I change the PO of the procurement manually, the behavior is the same. The procurement seems linked to the initial PO workflow.

Revision history for this message
Régis C. (reg53fr) wrote :

After some debugging, I found a solution :

1) When procurement.purchase_id changes (by user action or through purchase_requisition), update wkf_workitem.subflow_id with the wkf_instance.id of the new selected PO.

2) In purchase.requisition.partner wizard.create_order(), set purchase_order_line.move_dest_id with the same value as procurement.move_id in order to build a good move chain after PO confirmation.

I hope it will help !

Thanks

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.