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

hello everyone! anyone who can guide me how to convert the following code to odoo v17:


                                    {'required':[('lawyer_type','=','lawyer')]}                           

Avatar
Hylkää
Paras vastaus

it replace in odoo 17 attrs  to required="lawyer_type == 'lawyer'" and  invisible ="lawyer_type == 'lawyer'"

try this

Avatar
Hylkää
Paras vastaus

Hello Hamza,


I hope you're doing well.


Since Odoo 17.0, the "attrs" and "states" attributes are no longer used in the Odoo View architecture.

Instead, you can now use Python expressions that evaluate to a boolean for attributes like readonly, required, and invisible.


Old Code: {'required':[('lawyer_type','=','lawyer')]}

Migrated in V17.0: required="lawyer_type == 'lawyer'"


Kindly follow the document View architecture to understand the changes in odoo version 17.0

I hope this is helpful for you.

Thanks & Regards,

Email:   odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari 


Avatar
Hylkää
Paras vastaus

I guest this is in the xml, here is the converted code

required="lawyer_type == 'lawyer' "

Avatar
Hylkää

Hello remember my answer come first

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
elok. 25
308
1
tammik. 25
1581
1
marrask. 24
2009
2
syysk. 24
1566
4
syysk. 24
2343