i inherit module which have selection field and itry to change value of it
Itry to kep key and change value only but it has 5 values but i want only 4
so last one its still appear
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
i inherit module which have selection field and itry to change value of it
Itry to kep key and change value only but it has 5 values but i want only 4
so last one its still appear
You need to redefine the selection field in your inherited model and remove the key-value you want to remove.
Updated Answer:
try to call a method to get the options as below:
diet = fields.Selection(selection="_get_selection_diet_options",required=False)
def _get_selection_diet_options(self):
return [('dry', _("Dry")),('wet', _("Wet"))]
I remove value from inherent model but it still appear
:this is in original model:
diet = fields.Selection([('vegetarian', 'Vegetarian'),('lacto', 'Lact'),
('milk', 'milk')], 'Diet Type',required=True)
the inherit:
diet= fields.Selection([('dry', 'Dry '),('wet', 'Wet'),
]
,required=False)
I have updated my answer
This works! Thank you