Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3634 Переглядів

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
жовт. 24
189
0
груд. 23
1305
1
лип. 22
2291
1
серп. 20
4835
1
груд. 19
5254