Skip to Content
Menu
This question has been flagged
1 Reply
5725 Views

As i have read in this article: 

https://www.odoo.com/forum/help-1/question/multiple-attrs-in-form-86548

it should be possible to declare multiple conditional on attrs. I followed the example but the conditions :

<field name="firstname" attrs="{'invisible': [('is_company','=',True)], 'required':[('is_company', '=', 'False')]}"/>

only the invisible value is correctly set, required is not applied.
I checked the syntax, but it seems to be correct.
Do i miss something here?
( the value is_company is correctly used for the invisible value )


Avatar
Discard
Author Best Answer

I can see the error now in this condition. 

I am comparing a value to a string "False" and not a Boolean False.

It works perfectly fine now when doing it correct:

<field name="firstname" attrs="{'invisible': [('is_company','=',True)], 'required':[('is_company', '=', False)]}"/>


Avatar
Discard
Related Posts Replies Views Activity
1
Mar 15
8102
1
May 24
455
2
Aug 23
914
1
Jul 23
1052
0
Jul 23
971