diff --git a/modules/product/product.py b/modules/product/product.py index ad2a4733ea..fc2f158a7e 100644 --- a/modules/product/product.py +++ b/modules/product/product.py @@ -372,9 +372,10 @@ class Template( class TemplateFunction(fields.Function): - def __init__(self, field): + def __init__(self, field, searchable=True): super().__init__( - field, 'get_template', searcher='search_template') + field, 'get_template', + searcher='search_template' if searchable else None) # Disable on_change as it is managed by on_change_template self.on_change = set() self.on_change_with = set() @@ -619,7 +620,9 @@ class Product( tfield.states['invisible'] |= invisible_state else: tfield.states['invisible'] = invisible_state - setattr(cls, attr, TemplateFunction(tfield)) + searchable = tfield.searchable(Template) + setattr( + cls, attr, TemplateFunction(tfield, searchable=searchable)) order_method = getattr(cls, 'order_%s' % attr, None) if (not order_method and not isinstance(tfield, (