Odoo Help


Why « prod.uom_id » in purchase_requisition ?

Maurice Agée
on 9/8/15, 9:17 AM 748 views

I do not understand the syntax 'prod.uom_id' in the "def onchange_product_id" method of the module "purchase_requisition".

Is not this rather 'product.uom_id?


    value = {'product_uom_id': prod.uom_id.id, 'product_qty': 1.0}



Hardikgiri Goswami

--Hardikgiri Goswami--
| 2 2 5
Rajkot, India
--Hardikgiri Goswami--

OpenERP/Odoo Customization/Integration Expert / Python Programmer

Email : hardikgiri.goswami@gmail.com

Skype ID : hardikgiri.goswami

Hardikgiri Goswami
On 9/8/15, 9:33 AM

Hi Maurice,

prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
value = {'product_uom_id': prod.uom_id.id, 'product_qty': 1.0}
You can see in the above code. There is a object called "prod".
uom_id is the attribute of prod. so that's why it should be prod.uom_id

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/8/15, 9:17 AM
Seen: 748 times
Last updated: 9/8/15, 9:33 AM