Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
4170 Widoki

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

Awatar
Odrzuć
Autor

Thanks,,, ayman mohammed adam

Najlepsza odpowiedź

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.


Awatar
Odrzuć
Autor Najlepsza odpowiedź

 

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
gru 23
1831
3
maj 25
1584
1
kwi 25
1183
3
wrz 24
14030
2
lut 24
2380