Selected UOM does not belong to the same category as the product UOM If once the UOM set on Purchase Order line

Bug #954189 reported by Stefan Manteuffel
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 2

Bug Description

Hi,

in 6.1 i have the Problem that when i make an purchase order select create and then create an purchase order line.

When i select then a product i got allways "Selected UOM does not belong to the same category as the product UOM "

but the UOM are the same ?

When i go over warehouse incomming shipment - > create -> Stock Moves select a Product all is OK ?

Stefan

Related branches

Amit Parik (amit-parik)
affects: openobject-server → openobject-addons
Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Stefan Manteuffel,

I think you might have a misunderstanding something...
As per your scenario, I did not face any problem. This warning "Selected UOM does not belong to the same category as the product UOM" are raise when "product_uom" not matched with the "uom_id".

Moreover, when you select the product at "Stock Moves". UOM are set base on the product.

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
Stefan Manteuffel (b5c-linux-177) wrote : Re: [Bug 954189] Re: Selected UOM does not belong to the same category as the product UOM

Thank you verry much,

your video makes verry clear. I changed the default setting and now it
works.

There is only a smal question. Your viedeo was made with the web client,
but i haven't in the webclient the default setting with the mouse
button, only in gtk client. Or is an older version ?

Stefan

Am 14.03.2012 13:56, schrieb Amit Bhavsar (Open ERP):
> Hello Stefan Manteuffel,
>
> I think you might have a misunderstanding something...
> As per your scenario, I did not face any problem. This warning "Selected UOM does not belong to the same category as the product UOM" are raise when "product_uom" not matched with the "uom_id".
>
> Moreover, when you select the product at "Stock Moves". UOM are set base
> on the product.
>
> 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!
>
> ** Attachment added: "product_uom.ogv"
> https://bugs.launchpad.net/openobject-addons/+bug/954189/+attachment/2869161/+files/product_uom.ogv
>
> ** Changed in: openobject-addons
> Status: New => Incomplete
>

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote : Re: Selected UOM does not belong to the same category as the product UOM

Hello Stefan Manteuffel,

I have attached the screensort for "set default" in web. would you please check it.
As per your comment #2, I am closing this Issue.

Thanks!

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Hello Amit,

the warning message does not make sense, as it should be visualized when the user selects a UoM with a category that is different from the product's one. However, this seems to be impossible, thanks to the domain on uom field ( http://bazaar.launchpad.net/~openerp/openobject-addons/6.1/view/6782/purchase/purchase.py#L759 ).

See also http://bazaar.launchpad.net/~openerp/openobject-addons/6.1/view/6782/purchase/purchase.py#L767 .
As the uom field is always set to the product's uom, what is the usefulness of the warning?
I would suggest to remove it.

Changed in openobject-addons:
status: Invalid → New
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Lorenzo,

First of all Stefan's bug related to lp:958897, which was recently committed and will merge with trunk soon.

Now comes to your point. Yes there is a domain, it doesn't allow to select another uom which have a different category. But we have allow to create a new record from many2one (mainly in web client you can see "create and edit" option on many2one) field.

So there may be possibility that user could create a new "UoM" with different uom category, at that time this warning message should be raised. That's why we can not remove this warning message.

Hope this help for you.

Thanks for understanding!

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Here is my scenario:

 - Install purchase module
 - Create a product with 'kg' as UoM
 - Open new purchase order form and click on create purchase order line
 - Select the created product

Get
'Selected UOM does not belong to the same category as the product UOM'

Click OK and see 'Product UOM' is correctly 'kg'.

What does message mean? What is it for?

Maybe always loading 'product_uom_unit' as default ( http://bazaar.launchpad.net/~openerp/openobject-addons/6.1/view/7009/purchase/purchase.py#L649 ) is not needed

Changed in openobject-addons:
status: Invalid → New
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Lorenzo and Amit,

Hoping the one of the very old videos from us to help : http://youtu.be/jPEYSp3ejvw

We have used the demo data of OpenERP.

Thanks.

Revision history for this message
Carlos Contreras (carlos-realsystems) wrote :

Its correct

the error rises because uom_id always have a default UoM PCE and never gets true on line 765:

        if not uom_id:
            uom_id = product_uom_po_id

It solves adding one condition and it doesnt cause harm:

        if not uom_id or uom_id != product_uom_po_id:
            uom_id = product_uom_po_id

Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Carlos Contreras (carlos-realsystems) wrote :

I refer to purchase.py on purchase module.

Revision history for this message
Carlos Contreras (carlos-realsystems) wrote :

765:

        if not uom_id:
            uom_id = product_uom_po_id

It solves adding one condition and it doesnt cause harm:

        if not uom_id or uom_id != product_uom_po_id:
            uom_id = product_uom_po_id

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

Hello Folks,

Yes this problem still on trunk, this issue is partially related with lp:958897 but lp:958897 is already fixed on trunk, and I have faced the same issue show on comment#7.

@Serpent Services : Thanks for the good video.

Now I am confirming this issue.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
summary: - Selected UOM does not belong to the same category as the product UOM
+ Selected UOM does not belong to the same category as the product UOM If
+ once the UOM set on Purchase Order line
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Thank you for confirming Amit, we appreciate this.

Revision history for this message
Carlos Contreras (carlos-realsystems) wrote :
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Saurang Suthar(OpenERP) (ssu-openerp) wrote :

Hello Stefan Manteuffel,

We have fixed the problem in lp:~openerp-dev/openobject-addons/trunk-bug-954189-ssu branch, It will be merged soon in lp:openobject-addons.

Revision No: 8158
Revision ID: <email address hidden>

Thanks
Saurang Suthar

Changed in openobject-addons:
status: In Progress → Fix Committed
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.