Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3702 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
okt. 24
189
0
dec. 23
1385
1
jul. 22
2397
1
aug. 20
4901
1
dec. 19
5355