跳至内容
菜单
此问题已终结
4 回复
4155 查看

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

形象
丢弃
编写者

Thanks,,, ayman mohammed adam

最佳答案

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.


形象
丢弃
编写者 最佳答案

 

形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
2
12月 23
1829
3
5月 25
1576
1
4月 25
1177
3
9月 24
14016
2
2月 24
2376