(5.0) Inventory level wrong when purchase UoM different from default UoM

Bug #488736 reported by jan@synkronized.be
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Real and viritual stock levels are wrong when UoM in stock move is not default UoM.

To reproduce:

OpenERP V5.0.6
New database with profile manufacturing

Create UoM M, category Length, Rate:1
Create UoM 700M, category Length, Rate: 700

Create product "Test" with Default UoM: M, Purchase UoM: 700M

Create partner "Supplier"

Now:
When I buy 5 x 700 M of the product "Test" I get the correct stock move entry of Quantity:5 and UOM:700 M. However when I go into checking the real/viritual stock which is displayed using Default UoM, the system has counted 5 x M, i.e. it has booked 5 M instead of 3500 M.

The same wrong stock numbers occurs when a BOM books out materials from stock in a UOM different than the Default UoM.

Revision history for this message
jan@synkronized.be (jan-synkronized.be) wrote :

Ok, the UoM was configured wrong, instead of:
Create UoM 700M, category Length, Rate: 700
it should be:
Create UoM 700M, category Length, Rate: 0.001428 (leading to a Factor of 700.28)

This however creates a rounding problem (in inventory amongst others) when ordering 1x700M

The problem is that only Rate can be specified in UoM and Factor is calculated. In some circumstances (such as 700M) it's necessary to be able to specify the Factor instead of Rate.

Revision history for this message
jan@synkronized.be (jan-synkronized.be) wrote :

We wrote a small patch (attached). On the UoM screen, you can now either fill in Rate or Factor - depending on which is most suitable. No more need to specify digit numbers in Rate when you need a big Factor.

We used the existing field factor_inv_data to keep the factor data and removed factor_inv, which served as a confusing duplicate.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I understand the concern here, but I think having two fields editable is too confusing for users. It would even be better if we only needed to display one.
We have changed before between asking users to fill in the rate or fill in the factor, and nothing is satisfying everyone.

Perhaps we should do this differently and have something (wizard or text) more user-friendly that asks in english whether the new unit is supposed to be smaller or larger than the reference one, and by how much (e.g. 2x smaller or 2x larger, it would always be "2" you need to input: the intuitive amount the user is thinking of, and also the one with no rounding issue.)

BTW, a way to mitigate your specific issue without patch is to use an intermediary 70M unit as reference, so then you have 0.1 and 70 as the rates to use for 700M and M respectively. IIRC, the 70M UoM does not even need to be explicitly created if it's never used, it will be virtual.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

fixed with the new system in trunk.

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