I'd like field A to appear only if field B has a given value
field B doesn't belong to the same model, it belongs to a model connected through a many2one relationship
How do I write the contents of the attrs attribute for field A in the form ?
Until now I used
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
This question has been flagged
1
Reply
1080
Views
First, add a related field in a model where you have field A like this
field_b = field.fieldtype(related='many2one_field.field_b')
then you can use attrs to hide field A like this
attrs="{'invisible': [('field_b', '=', False)]}"
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
It works !
Thank you so much !