2
votes

Hope my message finds you well,

I had inherited a odoo model (product.attribute) and also had overridden a field (display_type).

class darazProductAttributes(models.Model):
    _inherit = "product.attribute"

    display_type = fields.Selection([
        ('text', 'Text'),
        ('radio', 'Radio'),
        ('select', 'Select'),
        ('color', 'Color')], default='radio', required=True, help="The display type used in the Product Configurator.")

i had added one more option (text) in field.Now the selection of option field it loads product.attribute.lines model form basically it have a onchange method.Odoo shows me that display_type have a onchange but odoo don't show method name. enter image description here

So i want to override that function.

Thanks

1
Note that you can use selection_add when inheriting a selection field to add only the new optionsKenly
Please provide a list of installed custom modules.Kenly
@Kenly i haven't installed any custom module .Hassan ALi
And secondly my issue is only with the onchange method.Hassan ALi

1 Answers

1
votes

Field can have more than one onchange method, all you have to do is look for methods that are decorated with onchange:

@api.onchange('your_field_name')