Is there a way to change whether the field is required or not based on some method or some other field in a different module?
Something that would work both on create and write?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Is there a way to change whether the field is required or not based on some method or some other field in a different module?
Something that would work both on create and write?
Create a related field and hide it in the form view, then write it into the attrs attribute of the view definition:
class my_model(osv.osv): _name = 'my.model' _columns = { # ... 'other_field': fields.related('other_object_id', 'other_object_field', type='boolean', string='Other Field'), }
<field name="my_field" attrs="{'required': [('other_field','=',True)]}"/>
<field name="other_field" invisible="1"/>
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
1
मार्च 15
|
7975 | ||
|
What is use of oldname?
Solved
|
|
2
अग॰ 22
|
14943 | |
|
|
0
जून 22
|
2235 | ||
|
|
1
अक्तू॰ 19
|
5534 | ||
|
|
2
सित॰ 19
|
6491 |