I am working with the
product.product class that inherits by delegation from
product.template. I want to access field
uos_id from the parent class. The field is defined as
fields.many2one('product.uom', 'Unit of Sale',help='Some text').
I tried to access the fields as follows:
product_obj = self.pool.get('product.product') product = product_obj.browse(cr, uid, product_id, context=context2) uom = product.uos_id
The code crashes some lines further because (I guess) the variable is empty. I suspect the issue is in the way I access the many2one field because when I use field uos_coeff from the parent class, it works fine (the field is defined as a
fields.float('Unit of Measure -> UOS Coeff', digits_compute= dp.get_precision('Product UoS'), help='Coefficient')
Any idea of what's wrong?
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
|Asked: 6/9/13, 8:49 AM|
|Seen: 1161 times|
|Last updated: 3/16/15, 8:10 AM|