Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
6100 Näkymät

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
Hylkää
Tekijä Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
maalisk. 15
8535
1
toukok. 24
1130
2
elok. 23
1573
1
heinäk. 23
1737
0
heinäk. 23
1484