I would like to have my selections depend on the value of a Char field, for instance, a Char field defined as such:
my_char = fields.Char("Enter Something", readonly = False)
so I suppose the selection field should call a function, something like "_get_value"
my_selection = fields.Selection(selection = ' _get_value')
@api.model
def _get_value(self):
my_list = [('key1','value1')]
#no idea how to assign the value of my_char to value1
return my_list
Eventually, I would like to have the selections in the drop down list vary as the user input different strings in my_char.
Is this achievable in Odoo? Because if it's not, I should better start reorganizing my structure. Thanks a lot.
my_char
field and then modifies it to write option_2, should your selection list be[('option_1', 'OPTION 1'), ('option_2', 'OPTION 2')]
or[('option_2', 'OPTION 2')]
? – forvasmany2many
instead ofselection
– qvpham