[mrp] action_po_assign() sometimes gets the price from the wrong supplier (5.0)

Bug #628702 reported by Dukai Gábor
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
Jay Vora (Serpent Consulting Services)
5.0
Fix Released
Low
Jay Vora (Serpent Consulting Services)
6.0
Fix Released
Low
JMA(Open ERP)

Bug Description

Hi!
5.0 latest bzr.
When generating POs, the procurement selects a supplier but sometimes finds the price of another supplier for the product.

Example:
Supplier A with a supplier price list defined as 'Partner section of the product form'
Supplier B with a supplier price list defined as 'Partner section of the product form'
Open a product and delete all the supplier information.
Add Supplier B first and set qty 1 and price 200. Save. Then add Supplier A and set qty 1 and price 100. Save.
Now set the sequence (priority) for Supplier B to 2.
Now Supplier A is the first on the list with the sequence of 1.
Set some orderpoint and generate POs with compute minimum stock rules.
Expected result: The PO should be generated for Supplier A with the price of 100.

Cancel the PO.
On the product form set Supplier A sequence to 2.
On the product form set Supplier B sequence to 1.
Now Supplier B is the first on the list with the sequence of 1.
Generate POs with compute minimum stock rules.
Expected result: The PO should be generated for Supplier B with the price of 200.

Check both POs, one should be for Supplier A with the price of 100 and one should be for Supplier B with the price of 200.
Problem: In the reality, both POs will have the same price, even they are for different suppliers.
Because partner_id is not passed to price_get(). See the patch attached.

Tags: 5.0

Related branches

Revision history for this message
Dukai Gábor (gdukai) wrote :
Revision history for this message
Samantha (samantha-z-mathews) wrote :

@Dukai Gábor it dsnt loop, takes the supplier with the specified priority da price given.

Changed in openobject-addons:
status: New → Triaged
tags: added: 5.0
Changed in openobject-addons:
assignee: nobody → Jay (OpenERP) (jvo-openerp)
importance: Undecided → Low
Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Dukai,

I define 2 suppliers as per your comment.
However, the price gets calculated on the basis of the supplier which we select on the sale order form.

So obviously things happen to go in proper flow. There is no way we would have price for the other supplier.
Unfortunately could not trace where it happens to break.

Thanks.

Revision history for this message
Dukai Gábor (gdukai) wrote :

Hello JMA,

The user doesn't select any supplier but OpenERP selects a supplier when the mrp scheduler for order points runs.

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Dukai,

Thank you for your quick response.
A detailed explanation with steps that you exactly follow would ease up things.
We would like to solve this issue.
Regards,
JMA.

Revision history for this message
Dukai Gábor (gdukai) wrote :

Hello JMA,

You are right, more steps are required to reproduce the bug. I've updated the bug description with the new steps.

Note: Since v6 the code has changed a bit so I'm attaching a patch for v6, too.

description: updated
Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Dukai,

Thank you for the description you provided.

Unfortunately am not able to generate the scenario that you posted.
I had these two doubts:
1. Are you sure, you save the record once you change the priority for the suppliers on the product form?
2. When you make a PO you are asked to select a Supplier.
And in order to have the prices that we have set 'As partner Section Of the Product form' you need to select the Supplier A or Supplier B else you would not get the price that you have set.

I guess it would be better if you share a video.
Even we would like to meet the mishap.

Thank you Dukai.
Regards,
JMA.

Revision history for this message
Dukai Gábor (gdukai) wrote :

By 'Generate POs with compute minimum stock rules' I mean
in v5:
to run the wizard 'mrp.procurement.orderpoint.compute'
in v6:
to run the osv_memory wizard 'procurement.orderpoint.compute'

_not_ to encode the PO by hand.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks a lot Dukai for your careful look at the problem and the patch.

Fix has been applied to both the stable versions authored to you.
5.0 : 2903 <email address hidden>
6.0 : 4420 <email address hidden>

Thanks for discussion JMA(OpenERP).

Changed in openobject-addons:
status: Triaged → Fix Released
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.