From b6ce915eef4545caecc0fb96cafbea30fa3c7905 Mon Sep 17 00:00:00 2001 From: "Abdelouahab (abla)" Date: Thu, 27 Jul 2023 13:20:06 +0000 Subject: [PATCH] [FIX] lunch: search domain type To reproduce ============ - on Lunch set a filter and try to save it to favorites an error is raised Problem ======= at this line https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/search/search_model.js#L1771 we are expecting `_getDomain` to return a Domain, but the overrided version on Lunch returns a List, so when we are calling `toString` it's not the one defined in `Domain.js` that will be called but the default one defined by JS, which is not expected in the rest of the process. Solution ======== `_getDomain` return type depends on the boolean `params.raw`, if it's `True` we return a Domain else we return a List. opw-3435524 closes odoo/odoo#132931 X-original-commit: ce21a4bc1057c251d39e44da30dd5ffadf354e4d Signed-off-by: Hubert Van De Walle Signed-off-by: Abdelouahab Laaroussi (abla) --- addons/lunch/static/src/views/search_model.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/lunch/static/src/views/search_model.js b/addons/lunch/static/src/views/search_model.js index 9c4fb53ab51..65a46adf85e 100644 --- a/addons/lunch/static/src/views/search_model.js +++ b/addons/lunch/static/src/views/search_model.js @@ -58,10 +58,10 @@ export class LunchSearchModel extends SearchModel { if (!this.lunchState.locationId) { return domain; } - - return Domain.and([ + const result = Domain.and([ domain, [['is_available_at', '=', this.lunchState.locationId]] - ]).toList(); + ]); + return params.raw ? result : result.toList(); } }