Hi,
I have an Odoo class with a date field and a selection field, like this:
from odoo import models, fields
class Test(models.Model):
_name = 'test'
name = fields.Char(string='Name')
date = fields.Date(string='Date')
selection = fields.Selection(string='Selection',
selection=[('todo', 'TODO'), ('done', 'Done')]It is possible to change the text of the selection depending of the date value? For exemple, if date = '2023-10-12', the selection list shoud be:
[('todo', 'TODO: 2023-10-12'), ('done', 'Done')]
and if the date is False, the selection list should be the default value ( [('todo', 'TODO'), ('done', 'Done')] ).
Thanks in advance,
Boris
This can;t be done in server side, You have to do it in JS side.
Another solution is to do it via Many2many connection.