Skip to Content
Menu
This question has been flagged
1 Reply
2974 Views

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
0
Oct 24
134
0
Dec 23
318
1
Jul 22
1253
1
Aug 20
3517
1
Dec 19
4145