希望我的消息对您很满意,
我继承了一个odoo模型(product.attribute),并且重写了一个字段(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.")
我在字段中添加了另一个选项(文本)。现在,选择字段的选择将加载product.attribute.lines模型窗体,基本上它具有onchange方法。方法名称。
所以我想重写该功能。
谢谢
字段可以具有多个onchange
方法,您要做的就是寻找以onchange
装饰的方法:
@api.onchange('your_field_name')