Trunk/7.0 Module Sale: default unit of measure of product dont load
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP R&D Addons Team 3 |
Bug Description
Hi OpenERP Team, I found this issue and im sure its a bug.
In a Sale Order Line, when I push the create sale order line link, the new empty line cames with the columns qty=1 and uom=unit(s) by default, so when I select a product, the default uom of product is no taked.
So the error here is assign a uom in the empty new sale order line.
I correct this problem commenting the line number 722 in the file "sale.py"
720 _order=..........
721 _defaults = {
722 # 'product_uom' : _get_uom_id,
723 'discount': 0.0,
724 'product_uom_qty': 1,
725 ...........
If the New Sale Order Line NO have uom assign, OpenERP Assign the correct uom of the product selected.
Example:
In this case, the product is moved in the warehouse in Packs x 4, Sale in Packs x 4, Purchase in Box x 12 of Packs x 4u and have devolutions in unit(s) (normaly 1 or 2 units).
Because the sales are in Packs x 4 I decide to set the default unit of measure of the Product (product.uom) in Packs x 4.
Unit of Measure
- Units(s) (Category=
- Pack x 4 (Category=Unit, factor=4)
- Box x 12 of Pksx4 (Category=Unit, factor=48)
Product X
- uom = Pack x 4 (default uom of the product, dont taked in SO)
- uos = null
- uop = Box x 12 of Pksx4 (Purchase, works fine in PO)
So try this:
Do a Sale, add a Line, choose PRODUCT X, and the uom still been "units". WRONG. Have to be Pack x 4.
Add a New Line, ERASE the uom "unit(s)" and choose the Product X, you can see the defaul uom of the product is load correct. Load Pack x 4
Please excuse my english,
Regards
Jose Balbuena
OPENERP 7.0
server revno.4971
web revno.3919
addons revno.9107
Hello Pepe,
Yes, you are absolutely correct. I was already fixed this issue ago when version7 was not released. Would you please check lp:958897.
I have already fixed this issue for sale and purchase both, see the branch lp:~openerp-dev/openobject-addons/trunk-bug-958897-amp.
Now I have seen this code again added on 4897.40.1 revision number.
As per my opinion, we have to fix it.
@RD team : would you please let us know why _get_uom_id will again added.
Thank you!