[6.1/Trunk] Purchase/Sale Order does not use product's non-reference Unit-type Unit of Measure

Bug #958897 reported by Ahmad Khayyat
36
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

Problem:

For a product using Unit-type units of measure, both Sales Orders and Purchase Orders use the reference unit of measure (PCE) and ignore the product's 'Default Unit of Measure' and 'Purchase Unit of Measure', respectively.

Steps to produce:

1. In product definition, use two different units for 'Default Unit of Measure' and 'Purchase Unit of Measure' that belong to the 'Unit' Unit of Measure category, but are different from the reference unit of measure (PCE).
E.g. create two new units of measure of category 'Unit': 'Pack 2' and 'Case 24' and use them as the 'Default Unit of Measure' and 'Purchase Unit of Measure', respectively.

Sales Order:
2. Crate a Sales Order, select a customer, and then create a Sales Order Line.
3. In the 'Create: Sales Order Lines', select a product whose Default Unit of Measure is not 'PCE' but is from the 'Unit' UoM Category, and notice that the UoM field remains PCE.

Purchase Order:

2. Create a Purchase Order, select a supplier, and then create a Purchase Order Line.
3. In the 'Create: Purchase Order Lines', select a product whose Default Unit of Measure is not 'PCE' but is from the 'Unit' UoM Category, and notice that the 'Product UOM' field remains PCE.

Expected Behavior:

The UoM field of the Sales Order and the Purchase Order lines should update to the product's respective units. This works for other UoM categories, but not for the 'Unit' category.

Tags: maintenance

Related branches

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Ahmad Khayyat,

I have checked your Issue, But I did not face any problem at my end. I have attached the video for your more reference. So would you please check it and notify us where you have faced the problem.

Thank you and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Ahmad Khayyat (akhayyat) wrote :

Thank you Amit for investigating this issue.

Your video does something very different. It creates two new UoM Categories. I am reporting an issue that only happens when using the 'Unit' category that is included in OpenERP by default. Using any UoM that belongs to any other category besides the 'Unit' category does not produce this bug: it triggers the warning message shown in your video, and then uses the correct UoM, as you have shown.

To product my bug, create two new UoMs that belong to the 'Unit' category.
For example, create these two UoMs (not UoM Categories):

Name: Pack 2
UoM Category: Unit
UoM Type: Bigger than the reference UoM
Rounding Precision: 1.00
Ratio: 2.00

Name : Case 24
UoM Category: Unit
UoM Type: Bigger than the reference UoM
Rounding Precision: 1.00
Ratio: 24.00

Then, pick a product, and set ' Pack 2' as its Default Unit of Measure, and set 'Case 24' as its Purchase Unit of Measre.

Then create a Sales Order or a Purchase Order and add that product to it, and see what UoM gets used.

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Ahmad Khayyat,

Thanks for the nice explanation and steps.
I have faced the same problem. So I confirm this Issue.

Thanks for the reporting!

Changed in openobject-addons:
status: Incomplete → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Changed in openobject-addons:
status: Confirmed → In Progress
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

I have attached branch for fix the problem on set the puchase unit of measure in Purchase order line.
Also I have assigned this issue to RD Team for same problem in sale order line . They will take appropriate decision for it.

This issue has been fixed with following branch and revision.

https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-958897-vpa

Revision info : 6748 <email address hidden>

Revision no : 6748

Thanks.

Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
status: In Progress → Confirmed
Revision history for this message
mvhman (michael-openrevolution) wrote :

I have tried this, however the warning message still occurs.
The if statement in the code still occurs and the warning is still produced. Though you can still continue with the uom being brought in.
eg.
829 uom_id = product_uom_po_id
830
 829 uom_id = product_uom_po_id

Can you please confirm that the warning disappears on your side.

Revision history for this message
mvhman (michael-openrevolution) wrote :

When looking at the code - the problem seems that the UOM already has a default value even when there is no product selected.
Thats why if any value other product with UOM other than PCE is selected, which is in a different UOM category it will send the warning.
Will it not be possible or rather better to remove the default value.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Michael,

I totally agree with you, vishal's branch doesn't solve this issue but It will created a new problem as you described (It will never raised a warning msg), So as per your comment#6 we have to improve our code. I will provide a branch which will remove the default uom_id shortly.

Thank you!

Amit Parik (amit-parik)
summary: - [6.1] Purchase/Sale Order does not use product's non-reference Unit-type
- Unit of Measure
+ [6.1/Trunk] Purchase/Sale Order does not use product's non-reference
+ Unit-type Unit of Measure
Changed in openobject-addons:
status: Confirmed → In Progress
importance: Low → Medium
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Ahmad,

Thanks for the reporting!

Your issue has been fixed on lp:~openerp-dev/openobject-addons/trunk-bug-958897-amp branch with following revision no and revision id.

rev no : 6758
rev Id : <email address hidden>

For Sale order line we have seen both UoM and UoS, So on sale order line's UoM field uom comes as a product 's default uom which is correct.

Thank you!

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Thanks for the action Amit, your proposal will do.

Additionally, the category check of UoM is not needed too.

Thanks.

tags: added: maintenance
Changed in openobject-addons:
status: Fix Committed → 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.