PO does wrongly take into account supplier information in product when using purchase UOM

Bug #423124 reported by Jan Verlaan
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Triaged
Undecided
Unassigned
Trunk
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

SITUATION IDENTIFIED IN:
Purchase order, price calculation of order line.

REPRODUCTION ENVIRONMENT:
Stable version 5.0.3 via bazaar updated today via bazaar.
revision-id: <email address hidden>
date: 2009-09-01 18:56:12 +0530
build-date: 2009-09-02 13:37:30 +0200
revno: 2372
branch-nick: addons

PROBLEM DESCRIPTION:
When using different product UOM's for storage and purchase, the price calculation for purchase order line is wrongly computed when making use of supplier information

SPECIFIC PARAMETER SETUP:
Go pricelist on PO --> Select the pricelist version --> Select Pricelist item.
Set based on selection field to be ''Partner section of the product form'.
See https://answers.launchpad.net/openobject-addons/+question/74021 where this process is answered.

STEPS TO BE FOLLOWED:
Create a product with storage unit is pair ( defined as 2 pcs) and purchase unit is Box (defined as 30 pcs = 15 pairs)
A Box of 15 pairs costs to purchase 47,93 euro excl. tax, resulting that a pair costs 3.1953333 euro.
The cost price of this product is stored as pair and rounded to 3.20 euro. No problem as we can set in purchase supplier information on the third tab that we purchase 1 box for 47,93 euro.

OBSERVED RESULT:
The PO is not taken into account the purchase unit. It will calculate always on storage unit, not on the purchase unit. This will result in using always rounded purchase prices of 3.20 euro, and not the 47,93 euro for 1 box. This way we never get the right purchase price on the purchase order.

EXPECTED RESULT:
That purchase price calculation will be based on the purchase unit defined in the product and that the supplier information does take the purchase unit into account (instead of the storage unit).

ADDITIONAL COMMENTS:
Tested on standard Manufacturing environment and Manufacturing environment with account_anglo_saxon module installed.
Please check when providing a standard solution if account_anglo_saxon needs a modification too (you may contact hda internally for this if needed).

Related branches

Revision history for this message
Husen Daudi (husendaudi) wrote :

Hello jan,
 I have following configuration for my product A.
Default UOM : 2PCS
Category : Unit
Rate: 0.5
rounding : 0.01

Purchase UOM: 30pcs
Category : Unit
Rate: 0.033333
rounding : 0.01

Cost Price of product A is 3.20.
Now I have created PO and select product A.
by selecting product A I am getting
Product UOM : 30PCS
Unit Price : 48.00

It means I am getting correct price for 30PCS.
Tell me if I am testing wrongly and reopen this post.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Yes I see :-) , your test will give the same result I have when testing the same. :-) :-) 3.20 x 15 2PCS = 48,00

Difference in our test is that I have defined a supplier info record at product level and the pricelist is taken from there.
Into the supplier info record is defined that a box (your 30PCS) cost 47,93
This unit box (your 30PCS) is not taken into account when computing the purchase order line. It handles if it is the storage unit.

The problem that does exist now is that a box of 15 pairs cost real 47,93 thus 3.1953333 per pair.
This is rounded correct by OpenERP to 3.20 for a pair on the product record.
But when generating the purchase order, now it multiply the 3.20 x 15 = 48 instead of taken the purchase unit for this purchase order and the linked defined supplier purchase price which is 47,93
Resulting in always to have to correct manually the corresponding invoices.

Hope I'm clear, do not hesitate to request more explanation if needed.

With kind regards,
Jan

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Husen Daudi (husendaudi) wrote :

You mean the pricelist in supplier info field under prices & suppliers tab of product form?

It will not be considered anywhere. Its just for prioritize suppliers. Pricelist in Purchase Order will be consider. I have checked and price is calculated correctly with Purchase pricelist.

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Correct, I mean pricelist in supplier info field under prices & suppliers tab of product form.
See https://answers.launchpad.net/openobject-addons/+question/74021 where this configuration process is answered.
If setup correctly it will take the above created supplier pricelist.

The fault is that in this case the purchase unit is not taken into account while creating a purchase order. It always takes the storage unit. Resulting in confusion because you buy always a box, but have to store the price in pricelist in storage unit? Resulting in having rounding issues as described in bug registration.

As used everywhere in the program, when purchasing, use the purchase unit and purchase price for this unit if defined.

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Jan Verlaan,

*Create a product with storage unit is pair ( defined as 2 pcs) and purchase unit is Box (defined as 30 pcs = 15 pairs)
=> I want ask you related to storage unit and purchase unit because in product we have 2 field related to UOM one is default UOM and another one is purchase UOM.
=>So I have put PCE as default and new Box as another unit with different rate.
=>So when i will create PO in PO line onchange of product show me purchase UOM by default and as the unit price(taken from supplier information) with UOM factor multiplication and Minimum qty which is also taken from supplier information.

So I got the unit price correct so i don't understand the following problem which you have defined above :

*That purchase price calculation will be based on the purchase unit defined in the product and that the supplier information does take the purchase unit into account (instead of the storage unit).

In Supplier information there is not any field available related to UOM how can you say the following statement :

"the supplier information does take the purchase unit into account (instead of the storage unit)"

Thanks.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
jan@synkronized.be (jan-synkronized.be) wrote :

An attempt to redefine the problem.

OpenERP 5.0.6, Manufacturing profile, standard demo data.

Case: I want to buy boxes of shoes (consisting of 15 pairs) at 47.93 € excl. tax. I want to sell them and keep inventory in pairs.

Steps:
Define an new Product: Pair of Shoes
  Default UoM: Pair, Category: Unit, Rate: 0.5
  Purchase UoM: Box, Category: Unit, Rate: 0.033333
  Tab Prices and Suppliers I add a new line for Supplier Information:
    Partner: Asustek
    Minimal Quantity: 1.00
    Pricelist: Quantity:1.00, Unit Price: 47.93 (I assume the Unit Price in the Prices and Suppliers listing refers to the purchase UoM, since we're talking suppliers here)

Change Default Pricelist Line to take prices from the Partner section of the product form

Now, I enter a purchase order for a pair of shoes. The Product UoM shows correctly: Box, but the Unit Price shows incorrectly 718.96

Now, I could change the Unit Price in the tab Prices and suppliers to 3.20 (which would be illogical, since we're talking suppliers here and I'd assume the unit price refers to the purchase UoM). But then purchase order shows a Unit Price of 48 €, which is incorrect.

Cheers,
Jan Blondé

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Thank you Jan, good write up! Glad we see the same inconsistency.

Changed in openobject-addons:
status: Incomplete → Confirmed
Revision history for this message
jan@synkronized.be (jan-synkronized.be) wrote :

Proposed patch

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

See also https://bugs.launchpad.net/openobject-addons/+bug/588663

The minimal quantity define on supplier info is expressed in purchase UOM (see action_po_assign of procurement) but the price on it is expressed in default UOM (see price_get on pricelist).

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Hello Jan,
Thanks for pointing out,
It has been fixed in lp:~openerp-dev/openobject-addons/rpa-dev-addons2 with
revision-id: <email address hidden> and improved later in <email address hidden> and <email address hidden>

You need to give 1.5977 (which is price of 1pcs) while defining supplier information,
[Also need to change Decimal Accuracy of Purchase Price to 4 in order to get proper price unit in PO line]

Thanks

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

will we shut this bug down , we use v6 and we find it ok!

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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