Good day Guys,
I have a field that is a Selection field e.g
type_main = fields.Selection(selection =([('a','A'),('b','B'),('c','C')]), 'Main Type')
but i want to dynamically show another field on the form view when either a, b or c is selected from the type_main field e.g i want that when you select A then a field that links to product.template module-(field.Many2one) is displayed, but if you select B then the displayed field is related to hr.employees-(field.Many2one) and finally selecting C displays a field that related to accounts.asset.asset (field.Many2one).
Any suggestions will be appreciated.
NB: Am using Odoo 8.
Thanks for your answers, it works now!. But i have the following issues with the solution
1) Am Using
widget="one2many_list"
to display the tree in another Model's view, all 3 fields field1, field2, field3 do not display inline, they all display at the bottom of the page when the corresponding type_main is selected, ie if i select Option A from type_main the field1 displays at the bottom of the page instead of in the tree view.. So my question is, is there a way to force a field display at a particular point on the page or at least correct this behaviour.
2) Also the label of the fields are always visible on the tree view from Q1, but i want them entirely hidden. I have tried to use
<field name="field1" attrs="{'invisible': [('type_main', '!=', 'a')]}" nolabel="1"/>
but it still permanently displays on the tree view. Is there a way to remove its label from the tree view?
NB: I tried to use comments but i dont have required karma, sorry guys.