Hi,
How do you hide field on a Form View
base on a field of another table?
Config Table field: tble_config.showlocation
Form Table field optional: customer.location_id
I want location_id to shown only when my tble_config.showlocation is true.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
How do you hide field on a Form View
base on a field of another table?
Config Table field: tble_config.showlocation
Form Table field optional: customer.location_id
I want location_id to shown only when my tble_config.showlocation is true.
Hi,
In your model, where you need to hide the field optionally, add a new related field or computed field, which compute the value from the other table, then based on this field you can hide the field using the attributes in the XML.
Steps:
Define new related/compute field in model A from model B
Add this field to corresponding view and keep it invisible
Based on the newly added control the visibility of the other field using the attrs in XML
Sample:
<field name="page_width" attrs="{'invisible': [('format','!=','custom')]}" />
Reference:
Thanks
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Mar 15
|
3364 | ||
|
1
Feb 21
|
12402 | ||
|
3
Mar 15
|
5750 | ||
|
0
Dec 24
|
58 | ||
|
1
Jun 22
|
3449 |