Odoo Help

0

Why « prod.uom_id » in purchase_requisition ?

By
Maurice Agée
on 9/8/15, 9:17 AM 489 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}

----

0

Hardikgiri Goswami

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

OpenERP/Odoo Customization/Integration Expert / Python Programmer

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.

Register

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)

Stats

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