From 9f5050ce0d49d3f049534f2097dcea3f48ec6e0e Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 21 Nov 2022 14:07:11 +0000 Subject: [PATCH] [FIX] mail: show activity groups with future items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When activity group (e.g. activities for Sale Orders) has future acitivities, but not today or overdue activities, the group is deleted. This is not what we want. In v15 it worked opposite way, but in v16 it was changed after js refactoring. Variable name for `total_count` is confusing. It actually means today activities + overdue activities [1] [1] https://github.com/odoo/odoo/blob/1666ee5515996fab8a843b36b4fd93b776172f75/addons/mail/models/res_users.py#L237-L238 opw-3042616 opw-3063110 closes odoo/odoo#106482 X-original-commit: b5aaf7b4ab78af29feab85066f4888d3cded018a Signed-off-by: Sébastien Theys (seb) Signed-off-by: Ivan Elizaryev (iel) --- addons/mail/static/src/models/activity_group.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/models/activity_group.js b/addons/mail/static/src/models/activity_group.js index a37c268829f..9849e00c589 100644 --- a/addons/mail/static/src/models/activity_group.js +++ b/addons/mail/static/src/models/activity_group.js @@ -28,7 +28,7 @@ Model({ * @private */ _onChangeTotalCount() { - if (this.type === "activity" && this.total_count === 0) { + if (this.type === "activity" && this.total_count === 0 && this.planned_count === 0) { this.delete(); } }, @@ -46,7 +46,7 @@ Model({ }, onChanges: [ { - dependencies: ["total_count", "type"], + dependencies: ["total_count", "type", "planned_count"], methodName: "_onChangeTotalCount", }, ],