Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am using V8 and I would like to read the value of a selection field from another form, normally which types should I use ? field.related or field.many2one or both of them.
The original model is "product.template" , I would like to know the value of the field "type" which is a selection field in the model.
the other model is "product.supplierinfo", It already contains a field which is defined as follows:
'product_tmpl_id' : fields.many2one('product.template', 'Product Template', required=True, ondelete='cascade', select=True, oldname='product_id'),
I extended this model to add a new field which will hold the value of the selection field in product using the incoming code:
product_type = fields.Selection(related='product_tmpl_id.type',store=True)
But when I open the form I don't find the selected type value, I just find the selection drop-down menu without selected option.
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
|Asked: 11/2/16, 10:48 AM|
|Seen: 899 times|
|Last updated: 11/3/16, 3:11 AM|