跳至內容
選單
此問題已被標幟
1 回覆
3560 瀏覽次數

Hi, I'm using Odoo 11.

I have a computed field:

subscription_end = fields.Date(string='Subscription end date', compute='_get_subscription_end')

The field is computed without a problem.

I also have a wizard with a method that writes to this field. This does not work since this field is a computed field. How can I change the value of the field from the wizard?

頭像
捨棄
最佳答案

Hi,

By default compute fields are not stored in the database. So when you are trying to write a value to this field which doesn't exist in the database. store=True may solve your problem. You can redefine your field as follows:

subscription_end = fields.Date(string='Subscription end date', compute='_get_subscription_end', store=True)

Regards

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
10月 24
189
0
12月 23
1246
1
7月 22
2229
1
8月 20
4800
1
12月 19
5191