Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
4 Antwoorden
4159 Weergaven

Why I cant able to store the particular value in the grid table after making that field as readonly

Since I gave that field as store=True

Avatar
Annuleer
Auteur

Thanks,,, ayman mohammed adam

Beste antwoord

You want the field to be Readonly, but trying to add value through Onchange or so, then you need to under-go hassle of updating for the same again in the Create/Write ORM methods.

Instead the feasible alternate solution would be you to use Compute/functional fields.

Api decorator lets you add depends(dependency) field, which acts as both onchange and computational method, that way you don't have to worry about manually re-updating the same in ORM methods.


Note:

If a field is marked as Readonly, odoo will explicitly omit retrieving data for the same from UI, hence in such case its best to use computational/related fields.


Avatar
Annuleer
Auteur Beste antwoord

 

Avatar
Annuleer
Beste antwoord

dear Karan Gupta

you need to override create and write method and assign the value again by calling your onchange function and then update the vals.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
dec. 23
1829
3
mei 25
1576
1
apr. 25
1178
3
sep. 24
14020
2
feb. 24
2377