From e11e3ca447fa2997b51a39cefc3457ae411ccb3c Mon Sep 17 00:00:00 2001 From: Khushi Date: Mon, 29 Jan 2024 11:11:00 +0000 Subject: [PATCH] [FIX] mail: activity model domain Steps to reproduce: Select a document in activity view to get its preview Click the archive button => traceback Before this commit: The 'load' method of Activity Model led to the traceback while attempting to set the domain of params, when none were received. (bug introduced by : 7682286) After this commit: This issue is resolved by tweaking the code of 'load' method. In case of default params, it now directly sets a domain, instead of trying to add a domain to the one obtained in params. Task ID : 3704340 closes odoo/odoo#152335 X-original-commit: 725ebab1f0c7ffc996414c85fbbd162afc4ecaf5 Signed-off-by: Thibault Delavallee (tde) Signed-off-by: Khushi Patel (khpa) --- addons/mail/static/src/views/web/activity/activity_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/views/web/activity/activity_model.js b/addons/mail/static/src/views/web/activity/activity_model.js index 74381b4628d..e9a3f2f8352 100644 --- a/addons/mail/static/src/views/web/activity/activity_model.js +++ b/addons/mail/static/src/views/web/activity/activity_model.js @@ -9,7 +9,7 @@ export class ActivityModel extends RelationalModel { this.originalDomain = params.domain ? [...params.domain] : []; // Ensure that only (active) records with at least one activity, "done" (archived) or not, are fetched. // We don't use active_test=false in the context because otherwise we would also get archived records. - params.domain = [...params.domain, ["activity_ids.active", "in", [true, false]]]; + params.domain = [...(params.domain || []), ["activity_ids.active", "in", [true, false]]]; if (params && "groupBy" in params) { params.groupBy = []; }