-
-
Notifications
You must be signed in to change notification settings - Fork 588
Open
Labels
Description
Module
l10n_es_partner
Describe the bug
Incompatibility with the base_search_custom_field_filter module.
To Reproduce
Create a custom filter field for the res.partner model

Now, with the new version of the l10n_es_partner module, if we go to contacts it gives an error because it is not a str.
OCA/l10n-spain/l10n_es_partner/models/res_partner.py", line 75, in get_views
res["views"]["search"]["arch"] = res["views"]["search"]["arch"].replace(
TypeError: a bytes-like object is required, not 'str'
This is because the base_search_custom_field_filter module returns the search view encoded in base64 instead of str, resulting in an error in the replace() function.
@api.model
def get_views(self, views, options=None):
res = super().get_views(views, options)
# Inject the commercial field into the domain when searching by complete_name
if "search" in res["views"]:
res["views"]["search"]["arch"] = res["views"]["search"]["arch"].replace(
"'|', ('complete_name', 'ilike', self)",
"'|','|',('complete_name','ilike',self),('comercial','ilike',self)",
)
return res
Reactions are currently unavailable