[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) <tde@openerp.com>
Signed-off-by: Khushi Patel (khpa) <khpa@odoo.com>
This commit is contained in:
Khushi
2024-02-05 18:24:43 +00:00
parent 5ec27bfaeb
commit e11e3ca447
@@ -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 = [];
}