diff --git a/mail_activity_future_counter/README.rst b/mail_activity_future_counter/README.rst new file mode 100644 index 000000000..7c7c0a396 --- /dev/null +++ b/mail_activity_future_counter/README.rst @@ -0,0 +1,88 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================ +Mail Activity Future Counter +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d21f6a0040bd8c8d9d75d78fe5534af4ed522b602e4f1e17f3be707c14b78d3a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/17.0/mail_activity_future_counter + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-17-0/mail-17-0-mail_activity_future_counter + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a badge counter on the bottom-right of the activity +clock icon in the navigation bar, showing the count of future +activities. + +By default, Odoo only shows overdue + today activities in a badge on the +top-right of the clock icon. This module complements that by showing +future activities separately. + +Features: + +- Blue badge on bottom-right of the activity icon +- Shows count of all future activities +- Does not interfere with the existing top-right badge for + overdue/today activities + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ForgeFlow + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_activity_future_counter/__init__.py b/mail_activity_future_counter/__init__.py new file mode 100644 index 000000000..5cb77b7bf --- /dev/null +++ b/mail_activity_future_counter/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/mail_activity_future_counter/__manifest__.py b/mail_activity_future_counter/__manifest__.py new file mode 100644 index 000000000..e7662f31b --- /dev/null +++ b/mail_activity_future_counter/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Mail Activity Future Counter", + "summary": """Add a badge counter on the bottom-right of the activity + clock icon of the navigation bar, showing the count of future activities.""", + "version": "17.0.1.0.0", + "development_status": "Beta", + "category": "Social Network", + "website": "https://github.com/OCA/mail", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": ["mail"], + "assets": { + "web.assets_backend": [ + "mail_activity_future_counter/static/src/activity_menu_patch.esm.js", + "mail_activity_future_counter/static/src/activity_menu_patch.xml", + "mail_activity_future_counter/static/src/activity_menu_patch.scss", + ], + }, +} diff --git a/mail_activity_future_counter/pyproject.toml b/mail_activity_future_counter/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/mail_activity_future_counter/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_activity_future_counter/readme/DESCRIPTION.md b/mail_activity_future_counter/readme/DESCRIPTION.md new file mode 100644 index 000000000..93f759e84 --- /dev/null +++ b/mail_activity_future_counter/readme/DESCRIPTION.md @@ -0,0 +1,11 @@ +This module adds a badge counter on the bottom-right of the activity clock icon +in the navigation bar, showing the count of future activities. + +By default, Odoo only shows overdue + today activities in a badge on the top-right of the clock icon. +This module complements that by showing future activities separately. + +Features: + +* Blue badge on bottom-right of the activity icon +* Shows count of all future activities +* Does not interfere with the existing top-right badge for overdue/today activities diff --git a/mail_activity_future_counter/static/description/index.html b/mail_activity_future_counter/static/description/index.html new file mode 100644 index 000000000..d98d02f76 --- /dev/null +++ b/mail_activity_future_counter/static/description/index.html @@ -0,0 +1,434 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Mail Activity Future Counter

+ +

Beta License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

This module adds a badge counter on the bottom-right of the activity +clock icon in the navigation bar, showing the count of future +activities.

+

By default, Odoo only shows overdue + today activities in a badge on the +top-right of the clock icon. This module complements that by showing +future activities separately.

+

Features:

+
    +
  • Blue badge on bottom-right of the activity icon
  • +
  • Shows count of all future activities
  • +
  • Does not interfere with the existing top-right badge for +overdue/today activities
  • +
+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/mail project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/mail_activity_future_counter/static/src/activity_menu_patch.esm.js b/mail_activity_future_counter/static/src/activity_menu_patch.esm.js new file mode 100644 index 000000000..565ccc23a --- /dev/null +++ b/mail_activity_future_counter/static/src/activity_menu_patch.esm.js @@ -0,0 +1,15 @@ +/** @odoo-module **/ + +import {ActivityMenu} from "@mail/core/web/activity_menu"; +import {patch} from "@web/core/utils/patch"; + +patch(ActivityMenu.prototype, { + async fetchSystrayActivities() { + await super.fetchSystrayActivities(); + let futureTotal = 0; + for (const group of this.store.activityGroups) { + futureTotal += group.planned_count || 0; + } + this.store.activityFutureCounter = futureTotal; + }, +}); diff --git a/mail_activity_future_counter/static/src/activity_menu_patch.scss b/mail_activity_future_counter/static/src/activity_menu_patch.scss new file mode 100644 index 000000000..86a562bdb --- /dev/null +++ b/mail_activity_future_counter/static/src/activity_menu_patch.scss @@ -0,0 +1,4 @@ +.o_menu_systray .o-mail-ActivityMenu-futureCounter { + background-color: $cyan !important; + transform: translate(-1.9em, 70%) !important; +} diff --git a/mail_activity_future_counter/static/src/activity_menu_patch.xml b/mail_activity_future_counter/static/src/activity_menu_patch.xml new file mode 100644 index 000000000..99f985b91 --- /dev/null +++ b/mail_activity_future_counter/static/src/activity_menu_patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + +