[FIX] mail: show activity groups with future items

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) <seb@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
This commit is contained in:
Ivan Yelizariev
2022-11-25 15:56:44 +01:00
parent 356a8ed6cd
commit 9f5050ce0d
@@ -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",
},
],