diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a06488079fed..6032014807ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,10 +36,19 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest + exclude: "web_responsive" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest + exclude: "web_responsive" name: test with OCB makepot: "true" + - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest + include: "web_responsive" + name: test with Odoo (rebel modules) + - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest + include: "web_responsive" + name: test with OCB (rebel modules) + makepot: "true" services: postgres: image: postgres:12.0 @@ -50,6 +59,8 @@ jobs: ports: - 5432:5432 env: + INCLUDE: "${{ matrix.include }}" + EXCLUDE: "${{ matrix.exclude }}" OCA_ENABLE_CHECKLOG_ODOO: "1" steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 6235317335f3..e3d1080a22c3 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,13 @@ addon | version | maintainers | summary --- | --- | --- | --- [web_calendar_slot_duration](web_calendar_slot_duration/) | 18.0.1.0.0 | Yajo | Customizable calendar slot durations [web_chatter_position](web_chatter_position/) | 18.0.1.0.0 | trisdoan | Add an option to change the chatter position -[web_company_color](web_company_color/) | 18.0.1.0.1 | | Web Company Color +[web_company_color](web_company_color/) | 18.0.1.0.3 | | Web Company Color [web_copy_confirm](web_copy_confirm/) | 18.0.1.0.0 | | Show confirmation dialogue before copying records [web_dialog_size](web_dialog_size/) | 18.0.1.0.0 | | A module that lets the user expand a dialog box to the full screen width. [web_disable_export_group](web_disable_export_group/) | 18.0.1.0.0 | | Web Disable Export Group [web_editor_class_selector](web_editor_class_selector/) | 18.0.1.0.0 | carlos-lopez-tecnativa | Web editor class selector [web_environment_ribbon](web_environment_ribbon/) | 18.0.1.0.3 | | Web Environment Ribbon +[web_excel_export_dynamic_expand](web_excel_export_dynamic_expand/) | 18.0.1.0.0 | | Export collapsed groups or the full tree, based on its view. [web_favicon](web_favicon/) | 18.0.1.0.0 | | Allows to set a custom shortcut icon (aka favicon) [web_filter_header_button](web_filter_header_button/) | 18.0.1.0.0 | | Show selected filters as buttons in the control panel [web_group_expand](web_group_expand/) | 18.0.1.0.1 | | Group Expand Buttons @@ -38,6 +39,7 @@ addon | version | maintainers | summary [web_no_bubble](web_no_bubble/) | 18.0.1.0.0 | | Remove the bubbles from the web interface [web_notify](web_notify/) | 18.0.1.1.0 | | Send notification messages to user [web_notify_channel_message](web_notify_channel_message/) | 18.0.1.0.0 | | Send an instant notification to channel users when a new message is posted +[web_notify_upgrade](web_notify_upgrade/) | 18.0.1.0.0 | | Notify active users when a module is installed or updated [web_pivot_computed_measure](web_pivot_computed_measure/) | 18.0.1.0.4 | CarlosRoca13 | Web Pivot Computed Measure [web_quick_start_screen](web_quick_start_screen/) | 18.0.1.0.0 | | Configurable start screen for quick actions [web_refresher](web_refresher/) | 18.0.1.0.0 | | Web Refresher diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index 476136524c43..b29201ae1e4d 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "odoo-addons-oca-web" -version = "18.0.20250826.0" +version = "18.0.20250908.1" dependencies = [ "odoo-addon-web_calendar_slot_duration==18.0.*", "odoo-addon-web_chatter_position==18.0.*", @@ -10,6 +10,7 @@ dependencies = [ "odoo-addon-web_disable_export_group==18.0.*", "odoo-addon-web_editor_class_selector==18.0.*", "odoo-addon-web_environment_ribbon==18.0.*", + "odoo-addon-web_excel_export_dynamic_expand==18.0.*", "odoo-addon-web_favicon==18.0.*", "odoo-addon-web_filter_header_button==18.0.*", "odoo-addon-web_group_expand==18.0.*", @@ -19,6 +20,7 @@ dependencies = [ "odoo-addon-web_no_bubble==18.0.*", "odoo-addon-web_notify==18.0.*", "odoo-addon-web_notify_channel_message==18.0.*", + "odoo-addon-web_notify_upgrade==18.0.*", "odoo-addon-web_pivot_computed_measure==18.0.*", "odoo-addon-web_quick_start_screen==18.0.*", "odoo-addon-web_refresher==18.0.*", diff --git a/web_company_color/README.rst b/web_company_color/README.rst index 5eeccac018c8..38d79d4f2f0c 100644 --- a/web_company_color/README.rst +++ b/web_company_color/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ================= Web Company Color ================= @@ -7,13 +11,13 @@ Web Company Color !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:603597734565684f2d0a6808b0bed21c04233046210e9c41d51b92d52c85cd57 + !! source digest: sha256:622d249810675797d351ceaaa800f9df89d92067ce131c14087b0b92fbf78283 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |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/licence-AGPL--3-blue.png +.. |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%2Fweb-lightgray.png?logo=github diff --git a/web_company_color/__manifest__.py b/web_company_color/__manifest__.py index 0fbc91fc8373..6bd35b046e8c 100644 --- a/web_company_color/__manifest__.py +++ b/web_company_color/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Web Company Color", "category": "web", - "version": "18.0.1.0.1", + "version": "18.0.1.0.3", "author": "Alexandre Díaz, Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "depends": ["web", "base_sparse_field"], diff --git a/web_company_color/models/assetsbundle.py b/web_company_color/models/assetsbundle.py index c26e0e16f936..e416e20a28cd 100644 --- a/web_company_color/models/assetsbundle.py +++ b/web_company_color/models/assetsbundle.py @@ -10,7 +10,7 @@ def get_company_color_asset_node(self): """Process the user active company scss and returns the node to inject""" try: active_company_id = int( - request.httprequest.cookies.get("cids", "").split(",")[0] + request.httprequest.cookies.get("cids", "").split("-")[0] ) except Exception: active_company_id = False diff --git a/web_company_color/models/res_company.py b/web_company_color/models/res_company.py index ee4d5ba0222e..0dc6d2147192 100644 --- a/web_company_color/models/res_company.py +++ b/web_company_color/models/res_company.py @@ -115,7 +115,7 @@ class ResCompany(models.Model): background-color: %(color_navbar_bg_hover)s !important; } } - .o_menu_systray .o-dropdown .dropdown-toggle { + .o_menu_systray button{ color: %(color_navbar_text)s !important; &:hover, &:focus, &:active, &:focus:active { background-color: %(color_navbar_bg_hover)s !important; diff --git a/web_company_color/static/description/index.html b/web_company_color/static/description/index.html index ea9578d9926c..36e812031a5a 100644 --- a/web_company_color/static/description/index.html +++ b/web_company_color/static/description/index.html @@ -3,7 +3,7 @@ -Web Company Color +README.rst -
-

Web Company Color

+
+ + +Odoo Community Association + +
+

Web Company Color

-

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

+

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

This module change navbar colors based in the company logo colors.

Table of contents

@@ -386,18 +391,18 @@

Web Company Color

-

Usage

+

Usage

Go to company record and set a logo. Can see/modify applied colors on the “Navbar” section.

For optimal results use images with alpha channel.

-

Known issues / Roadmap

+

Known issues / Roadmap

White color is omitted in the addition operation to support images without alpha channel.

-

Bug Tracker

+

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 @@ -405,15 +410,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Alexandre Díaz
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -443,5 +448,6 @@

Maintainers

+
diff --git a/web_excel_export_dynamic_expand/README.rst b/web_excel_export_dynamic_expand/README.rst new file mode 100644 index 000000000000..91705a9b6a1d --- /dev/null +++ b/web_excel_export_dynamic_expand/README.rst @@ -0,0 +1,82 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=============================== +Web Excel Export Dynamic Expand +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:0ebaf3ae34e14b004119de667f5e9923e0e3cc6a0e57349fd4b860af03a2b9c2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/18.0/web_excel_export_dynamic_expand + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_excel_export_dynamic_expand + :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/web&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +When exporting a tree view to an Excel file, you can decide if you want +to export only the main groups or the full tree, depending if all groups +are collapsed, or there is one open. + +**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 + +Contributors +------------ + +- Arnau Cruz + +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/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_excel_export_dynamic_expand/__init__.py b/web_excel_export_dynamic_expand/__init__.py new file mode 100644 index 000000000000..e046e49fbe22 --- /dev/null +++ b/web_excel_export_dynamic_expand/__init__.py @@ -0,0 +1 @@ +from . import controllers diff --git a/web_excel_export_dynamic_expand/__manifest__.py b/web_excel_export_dynamic_expand/__manifest__.py new file mode 100644 index 000000000000..c7829110e1cf --- /dev/null +++ b/web_excel_export_dynamic_expand/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright (C) 2024 - ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Excel Export Dynamic Expand", + "summary": "Export collapsed groups or the full tree, based on its view.", + "version": "18.0.1.0.0", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "license": "AGPL-3", + "depends": ["web"], + "data": [], + "assets": { + "web.assets_backend": [ + "web_excel_export_dynamic_expand/static/src/js/data_export.esm.js", + ], + }, +} diff --git a/web_excel_export_dynamic_expand/controllers/__init__.py b/web_excel_export_dynamic_expand/controllers/__init__.py new file mode 100644 index 000000000000..14a7468918e2 --- /dev/null +++ b/web_excel_export_dynamic_expand/controllers/__init__.py @@ -0,0 +1 @@ +from . import excel_export diff --git a/web_excel_export_dynamic_expand/controllers/excel_export.py b/web_excel_export_dynamic_expand/controllers/excel_export.py new file mode 100644 index 000000000000..a5d96f866abb --- /dev/null +++ b/web_excel_export_dynamic_expand/controllers/excel_export.py @@ -0,0 +1,38 @@ +# Copyright 2024 ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import json +from collections import OrderedDict + +from odoo import http + +from odoo.addons.web.controllers.export import ExcelExport + + +class CustomGroupsTreeNode(ExcelExport): + @http.route("/web/export/xlsx", type="http", auth="user") + def web_export_xlsx(self, data): + params = json.loads(data) + self.context = params.get("context", {}) + response = super().web_export_xlsx(data) + return response + + @property + def context(self): + return self._context + + @context.setter + def context(self, value): + self._context = value + + def from_group_data(self, fields, columns_headers, groups): + collapse_groups = self.context.get("collapse_groups") + if collapse_groups: + for _child_key, child_node in groups.children.items(): + aggregated_values = child_node.aggregated_values + if child_node.children: + child_node.children = OrderedDict() + if child_node.data: + child_node.data = [] + child_node.aggregated_values = aggregated_values + return super().from_group_data(fields, columns_headers, groups) diff --git a/web_excel_export_dynamic_expand/i18n/it.po b/web_excel_export_dynamic_expand/i18n/it.po new file mode 100644 index 000000000000..c0d5085374bd --- /dev/null +++ b/web_excel_export_dynamic_expand/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" diff --git a/web_excel_export_dynamic_expand/i18n/web_excel_export_dynamic_expand.pot b/web_excel_export_dynamic_expand/i18n/web_excel_export_dynamic_expand.pot new file mode 100644 index 000000000000..aadee09bfeda --- /dev/null +++ b/web_excel_export_dynamic_expand/i18n/web_excel_export_dynamic_expand.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/web_excel_export_dynamic_expand/pyproject.toml b/web_excel_export_dynamic_expand/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_excel_export_dynamic_expand/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_excel_export_dynamic_expand/readme/CONTRIBUTORS.md b/web_excel_export_dynamic_expand/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..05cf886890dd --- /dev/null +++ b/web_excel_export_dynamic_expand/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Arnau Cruz \ diff --git a/web_excel_export_dynamic_expand/readme/DESCRIPTION.md b/web_excel_export_dynamic_expand/readme/DESCRIPTION.md new file mode 100644 index 000000000000..a4c59ad43d70 --- /dev/null +++ b/web_excel_export_dynamic_expand/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +When exporting a tree view to an Excel file, you can decide if you want +to export only the main groups or the full tree, depending if all groups +are collapsed, or there is one open. diff --git a/web_excel_export_dynamic_expand/static/description/icon.png b/web_excel_export_dynamic_expand/static/description/icon.png new file mode 100644 index 000000000000..1dcc49c24f36 Binary files /dev/null and b/web_excel_export_dynamic_expand/static/description/icon.png differ diff --git a/web_excel_export_dynamic_expand/static/description/index.html b/web_excel_export_dynamic_expand/static/description/index.html new file mode 100644 index 000000000000..efbef42210e4 --- /dev/null +++ b/web_excel_export_dynamic_expand/static/description/index.html @@ -0,0 +1,431 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Web Excel Export Dynamic Expand

+ +

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

+

When exporting a tree view to an Excel file, you can decide if you want +to export only the main groups or the full tree, depending if all groups +are collapsed, or there is one open.

+

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/web project on GitHub.

+

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

+
+
+
+
+ + diff --git a/web_excel_export_dynamic_expand/static/src/js/data_export.esm.js b/web_excel_export_dynamic_expand/static/src/js/data_export.esm.js new file mode 100644 index 000000000000..96158ab00cb2 --- /dev/null +++ b/web_excel_export_dynamic_expand/static/src/js/data_export.esm.js @@ -0,0 +1,17 @@ +import {patch} from "@web/core/utils/patch"; +import {ListController} from "@web/views/list/list_controller"; + +patch(ListController.prototype, { + async downloadExport() { + const hasDataRow = document.querySelectorAll(".o_data_row").length > 0; + const hasGroup = document.querySelectorAll(".o_group_header").length > 0; + const collapseGroups = !hasDataRow && hasGroup; + + this.props.context = { + ...this.props.context, + collapse_groups: collapseGroups, + }; + + await super.downloadExport(...arguments); + }, +}); diff --git a/web_notify_upgrade/README.rst b/web_notify_upgrade/README.rst new file mode 100644 index 000000000000..09e5d119f152 --- /dev/null +++ b/web_notify_upgrade/README.rst @@ -0,0 +1,90 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================== +Web Notify Upgrade +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c19c68174a60ed18be65dbd1dd4464927509139187f14f42a4c378d48d73312b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/18.0/web_notify_upgrade + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_notify_upgrade + :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/web&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module uses web_notify send a notification to every active users +whenever a module has been installed or upgraded. + +The notification will ask the user to refresh the page to get the latest +changes. + +|image1| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_notify_upgrade/static/description/notify.png + +**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 +------- + +* Akretion + +Contributors +------------ + +- `Akretion `__: + + - Florian Mounier + +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/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_notify_upgrade/__init__.py b/web_notify_upgrade/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/web_notify_upgrade/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/web_notify_upgrade/__manifest__.py b/web_notify_upgrade/__manifest__.py new file mode 100644 index 000000000000..4b38b46129e5 --- /dev/null +++ b/web_notify_upgrade/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2024 Akretion (http://www.akretion.com). +# @author Florian Mounier +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Notify Upgrade", + "summary": "Notify active users when a module is installed or updated", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "depends": ["web_notify"], + "author": "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "installable": True, +} diff --git a/web_notify_upgrade/i18n/fr.po b/web_notify_upgrade/i18n/fr.po new file mode 100644 index 000000000000..b262d01acac9 --- /dev/null +++ b/web_notify_upgrade/i18n/fr.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_notify_upgrade +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2024-08-14 16:58+0000\n" +"Last-Translator: David Beal \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_notify_upgrade +#: model:ir.model,name:web_notify_upgrade.model_ir_model_data +msgid "Model Data" +msgstr "Model Data" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +#, python-format +msgid "Reload" +msgstr "Recharger" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +#, python-format +msgid "Upgrade Notification" +msgstr "Notification de mise à jour" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +#, python-format +msgid "Your odoo instance has been upgraded, please reload the web page." +msgstr "Votre instance odoo a été mise à jour, merci de recharger la page web." diff --git a/web_notify_upgrade/i18n/it.po b/web_notify_upgrade/i18n/it.po new file mode 100644 index 000000000000..9eca29655e4a --- /dev/null +++ b/web_notify_upgrade/i18n/it.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_notify_upgrade +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-08-12 08:58+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: web_notify_upgrade +#: model:ir.model,name:web_notify_upgrade.model_ir_model_data +msgid "Model Data" +msgstr "Dati modello" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +#, python-format +msgid "Reload" +msgstr "Ricarica" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +#, python-format +msgid "Upgrade Notification" +msgstr "Aggiorna notifiche" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +#, python-format +msgid "Your odoo instance has been upgraded, please reload the web page." +msgstr "L'istanza Odoo è stata aggiornata, ricaricare la pagina web." diff --git a/web_notify_upgrade/i18n/web_notify_upgrade.pot b/web_notify_upgrade/i18n/web_notify_upgrade.pot new file mode 100644 index 000000000000..68c79cfebbe9 --- /dev/null +++ b/web_notify_upgrade/i18n/web_notify_upgrade.pot @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_notify_upgrade +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_notify_upgrade +#: model:ir.model,name:web_notify_upgrade.model_ir_model_data +msgid "Model Data" +msgstr "" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +msgid "Reload" +msgstr "" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +msgid "Upgrade Notification" +msgstr "" + +#. module: web_notify_upgrade +#. odoo-python +#: code:addons/web_notify_upgrade/models/ir_model.py:0 +msgid "Your odoo instance has been upgraded, please reload the web page." +msgstr "" diff --git a/web_notify_upgrade/models/__init__.py b/web_notify_upgrade/models/__init__.py new file mode 100644 index 000000000000..413bb2380140 --- /dev/null +++ b/web_notify_upgrade/models/__init__.py @@ -0,0 +1 @@ +from . import ir_model diff --git a/web_notify_upgrade/models/ir_model.py b/web_notify_upgrade/models/ir_model.py new file mode 100644 index 000000000000..fdb4e5509290 --- /dev/null +++ b/web_notify_upgrade/models/ir_model.py @@ -0,0 +1,61 @@ +# Copyright 2024 Akretion (http://www.akretion.com). +# @author Florian Mounier +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import logging + +from odoo import _, api, models + +from odoo.addons.bus.models.bus_presence import AWAY_TIMER, DISCONNECTION_TIMER + +_logger = logging.getLogger(__name__) + + +class IrModelData(models.Model): + _inherit = "ir.model.data" + + @api.model + def _process_end(self, modules): + # This function is called at the end of the module installation + # only if at least a module has been installed or updated. + rv = super()._process_end(modules) + self._notify_active_users_of_upgrade() + return rv + + def _notify_active_users_of_upgrade(self): + # Look for active users + active_users = self._get_active_users_to_notify_of_upgrade() + if active_users: + _logger.info( + "Installation detected. Notifying %s active users", len(active_users) + ) + # Notify them + active_users.notify_info(**self._get_upgrade_notification_params()) + + def _get_active_users_to_notify_of_upgrade(self): + """Return the active users that should be notified of the upgrade.""" + self.env.cr.execute( + """ + SELECT user_id + FROM bus_presence + WHERE last_poll is not null + AND ( + age(now() AT TIME ZONE 'UTC', last_poll) < interval %s + OR age(now() AT TIME ZONE 'UTC', last_presence) < interval %s + ) + """, + (f"{DISCONNECTION_TIMER} seconds", f"{AWAY_TIMER} seconds"), + ) + return self.env["res.users"].browse([res[0] for res in self.env.cr.fetchall()]) + + def _get_upgrade_notification_params(self): + """Return the parameters to pass to the notify_info method.""" + return dict( + message=_( + "Your odoo instance has been upgraded, " "please reload the web page." + ) + + "
" + '", + title=_("Upgrade Notification"), + sticky=True, + ) diff --git a/web_notify_upgrade/pyproject.toml b/web_notify_upgrade/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_notify_upgrade/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_notify_upgrade/readme/CONTRIBUTORS.md b/web_notify_upgrade/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..3b52e04e621e --- /dev/null +++ b/web_notify_upgrade/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Akretion](https://www.akretion.com): + - Florian Mounier diff --git a/web_notify_upgrade/readme/DESCRIPTION.md b/web_notify_upgrade/readme/DESCRIPTION.md new file mode 100644 index 000000000000..1e3a0476e3e7 --- /dev/null +++ b/web_notify_upgrade/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module uses web_notify send a notification to every active users +whenever a module has been installed or upgraded. + +The notification will ask the user to refresh the page to get the latest +changes. + +![](../static/description/notify.png) diff --git a/web_notify_upgrade/static/description/icon.png b/web_notify_upgrade/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/web_notify_upgrade/static/description/icon.png differ diff --git a/web_notify_upgrade/static/description/index.html b/web_notify_upgrade/static/description/index.html new file mode 100644 index 000000000000..c9af547f9785 --- /dev/null +++ b/web_notify_upgrade/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Web Notify Upgrade

+ +

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

+

This module uses web_notify send a notification to every active users +whenever a module has been installed or upgraded.

+

The notification will ask the user to refresh the page to get the latest +changes.

+

image1

+

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

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

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/web project on GitHub.

+

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

+
+
+
+
+ + diff --git a/web_notify_upgrade/static/description/notify.png b/web_notify_upgrade/static/description/notify.png new file mode 100644 index 000000000000..d605e3ff894e Binary files /dev/null and b/web_notify_upgrade/static/description/notify.png differ diff --git a/web_systray_button_init_action/i18n/it.po b/web_systray_button_init_action/i18n/it.po index d3c5dc888bee..f0bc80a43b1a 100644 --- a/web_systray_button_init_action/i18n/it.po +++ b/web_systray_button_init_action/i18n/it.po @@ -6,16 +6,18 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2025-09-08 10:43+0000\n" +"Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" #. module: web_systray_button_init_action #. odoo-javascript #: code:addons/web_systray_button_init_action/static/src/button/button.xml:0 msgid "Init Action" -msgstr "" +msgstr "Inizializza azione"