İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3548 Görünümler

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?

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Eki 24
189
0
Ara 23
1239
1
Tem 22
2215
1
Ağu 20
4787
1
Ara 19
5177