Skip to Content
Menu
This question has been flagged
1 Reply
3918 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}

----

Avatar
Discard
Best Answer

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
Avatar
Discard