Skip to content
Snippets Groups Projects
  • Paul Morelle's avatar
    b43d79b1
    [FIX] website_customer: make res.partner.tag.classname overridable · b43d79b1
    Paul Morelle authored
    
    The selection function get_selection_class for the field classname has
    obviously been thought to be overridable by subclasses in order to add
    new selection classes if need be.
    
    However, before this commit the method was passed directly to the
    Selection constructor, which used the callable object directly. If it
    was overridden by a subclass, the Selection object would still use the
    same non-overridden callable instance.
    
    With this commit, we give the name of the method instead of the
    callable, which makes that the method is resolved after all overrides,
    and therefore the resulting selection will be the overridden one.
    
    closes odoo/odoo#122377
    
    X-original-commit: 91bea596
    Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
    Signed-off-by: default avatarPaul Morelle (pmo) <pmo@odoo.com>
    b43d79b1
    History
    [FIX] website_customer: make res.partner.tag.classname overridable
    Paul Morelle authored
    
    The selection function get_selection_class for the field classname has
    obviously been thought to be overridable by subclasses in order to add
    new selection classes if need be.
    
    However, before this commit the method was passed directly to the
    Selection constructor, which used the callable object directly. If it
    was overridden by a subclass, the Selection object would still use the
    same non-overridden callable instance.
    
    With this commit, we give the name of the method instead of the
    callable, which makes that the method is resolved after all overrides,
    and therefore the resulting selection will be the overridden one.
    
    closes odoo/odoo#122377
    
    X-original-commit: 91bea596
    Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
    Signed-off-by: default avatarPaul Morelle (pmo) <pmo@odoo.com>
res_partner.py 1.24 KiB