I am trying to hide a field based on an option selected from a drop down.
In my py file I have:
hide = fields.Boolean(string= 'Hide' , compute= "_compute_hide" )
@api.onchange( 'math_type_cfg_id' )
def _onchange_math_type_cfg_id(self):
if self .math_type_cfg_id == '5' :
self.hide = True
else :
self.hide = False
In my view I have:
<field name = "c_math_cfg_id"
required = "math_type_cfg_id == 5"
invisible = "'[('hide', '=', True)]"
/>
The required works but the field will not disappear.
Any help would be greatly appreciated!