web_edit_user_filter: Fix selection of facet

When clicking to edit a filter in search view, the _process_filters
function will receive the faceID argument as a string, which will
be compared to facet.groupId that is an Integer.

Therefore we should use == operator when comparing this value to
allow type coercion from JS.
pull/2644/head
Akim Juillerat 2023-10-19 13:29:09 +02:00
parent 41529c1fc9
commit 5ae07aaaf8
1 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
var selectedFacet = self.model.get("filters").filter(function (facet) {
return (
facet.type === facet_type &&
facet.groupId === facetId &&
facet.groupId == facetId &&
facet.isActive === true
);
});
@ -129,7 +129,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
var FavFacets = [];
var currentFacet = self.model.get(
"filters",
(f) => f.type === "favorite" && f.groupId === facetId
(f) => f.type === "favorite" && f.groupId == facetId
);
if (currentFacet[0].groupBys.length) {
_.each(currentFacet[0].groupBys, function (description) {