I have created a parent model, which has a Selection field. This pattern must be inherited from classes that offer a service, so in the child classes I use fields.Selection(selection_add = ....). Is it possible to create, in the parent class, an "empty" selection that will only fill with the selection fields of the models that inherit it? Ex
class GenericService(models.Model):
_name = 'generic.service'
selection_type = fields.Selection(
[('select_type', _("Select an Account")),],default='select_type',
string=_("Service Type"),
required=True
class SpecificService(model.Model):
_inherit = 'generic.service'
selection_type = fields.Selection(
selection_add=[('sftp','SFTP')],
)
I would like to avoid adding a default field on the generic model selection, my alternative is to create a method that controls the insertion, but I would like to know if it could be avoided.