Odoo Help

Welcome!

This community 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.

0

Why « prod.uom_id » in purchase_requisition ?

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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