diff --git a/web_select_all_companies/README.rst b/web_select_all_companies/README.rst new file mode 100644 index 000000000000..816a9db0d04b --- /dev/null +++ b/web_select_all_companies/README.rst @@ -0,0 +1,81 @@ +======================== +Web Select All Companies +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:33e9484d15ff36e8cdab3b893cfdb6c54b11dca7fc7ef89e420edc420d310ec1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/17.0/web_select_all_companies + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_select_all_companies + :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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to select or deselect all the companies in a +single click. + +|image| + +.. |image| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_select_all_companies/static/description/select_all_companies.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 +------- + +* Camptocamp + +Contributors +------------ + +- Telmo Santos + +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_select_all_companies/__init__.py b/web_select_all_companies/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_select_all_companies/__manifest__.py b/web_select_all_companies/__manifest__.py new file mode 100644 index 000000000000..4f46a1d8c202 --- /dev/null +++ b/web_select_all_companies/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Camptocamp SA - Telmo Santos +# Copyright 2024 GumbysBE - Yannick Olivier +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +{ + "name": "Web Select All Companies", + "summary": "Allows you to select all companies in one click.", + "version": "17.0.1.0.0", + "category": "Web", + "website": "https://github.com/OCA/web", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "LGPL-3", + "depends": ["web"], + "assets": { + "web.assets_backend": [ + "web_select_all_companies/static/src/xml/switch_all_company_menu.xml", + "web_select_all_companies/static/src/js/switch_all_company_menu.esm.js", + ], + }, + "installable": True, +} diff --git a/web_select_all_companies/i18n/es.po b/web_select_all_companies/i18n/es.po new file mode 100644 index 000000000000..a3b38f764223 --- /dev/null +++ b/web_select_all_companies/i18n/es.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_select_all_companies +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-08 23:01+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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 4.17\n" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "All Companies" +msgstr "Todas las compañías" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "Select All Companies" +msgstr "Seleccionar todas las compañías" diff --git a/web_select_all_companies/i18n/fr.po b/web_select_all_companies/i18n/fr.po new file mode 100644 index 000000000000..2523b4232c34 --- /dev/null +++ b/web_select_all_companies/i18n/fr.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_select_all_companies +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-06-16 06:01+0000\n" +"PO-Revision-Date: 2023-06-16 06:01+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "All Companies" +msgstr "Toutes Sociétés" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "Select All Companies" +msgstr "Sélectionnez toutes les sociétés" diff --git a/web_select_all_companies/i18n/it.po b/web_select_all_companies/i18n/it.po new file mode 100644 index 000000000000..73238a5256cc --- /dev/null +++ b/web_select_all_companies/i18n/it.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_select_all_companies +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:37+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 4.17\n" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "All Companies" +msgstr "Tutte le aziende" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "Select All Companies" +msgstr "Seleziona tutte le aziende" diff --git a/web_select_all_companies/i18n/nl_BE.po b/web_select_all_companies/i18n/nl_BE.po new file mode 100644 index 000000000000..8e4027550ffe --- /dev/null +++ b/web_select_all_companies/i18n/nl_BE.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_select_all_companies +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-04-15 14:44+0000\n" +"PO-Revision-Date: 2024-04-15 14:44+0000\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_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "All Companies" +msgstr "Alle bedrijven" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "Select All Companies" +msgstr "Selecteer Alle Bedrijven" \ No newline at end of file diff --git a/web_select_all_companies/i18n/web_select_all_companies.pot b/web_select_all_companies/i18n/web_select_all_companies.pot new file mode 100644 index 000000000000..0882aaf94eda --- /dev/null +++ b/web_select_all_companies/i18n/web_select_all_companies.pot @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_select_all_companies +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "All Companies" +msgstr "" + +#. module: web_select_all_companies +#. odoo-javascript +#: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 +#, python-format +msgid "Select All Companies" +msgstr "" diff --git a/web_select_all_companies/pyproject.toml b/web_select_all_companies/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_select_all_companies/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_select_all_companies/readme/CONTRIBUTORS.md b/web_select_all_companies/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..d65a531f37f4 --- /dev/null +++ b/web_select_all_companies/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Telmo Santos \<\> diff --git a/web_select_all_companies/readme/DESCRIPTION.md b/web_select_all_companies/readme/DESCRIPTION.md new file mode 100644 index 000000000000..df83939709e8 --- /dev/null +++ b/web_select_all_companies/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module allows you to select or deselect all the companies in a +single click. + +![image](./static/description/select_all_companies.png) diff --git a/web_select_all_companies/static/description/icon.png b/web_select_all_companies/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/web_select_all_companies/static/description/icon.png differ diff --git a/web_select_all_companies/static/description/index.html b/web_select_all_companies/static/description/index.html new file mode 100644 index 000000000000..1874c519c2fa --- /dev/null +++ b/web_select_all_companies/static/description/index.html @@ -0,0 +1,422 @@ + + + + + +Web Select All Companies + + + +
+

Web Select All Companies

+ + +

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

+

This module allows you to select or deselect all the companies in a +single click.

+

image

+

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

+
    +
  • Camptocamp
  • +
+
+ +
+

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_select_all_companies/static/description/select_all_companies.gif b/web_select_all_companies/static/description/select_all_companies.gif new file mode 100644 index 000000000000..e9c3b35af229 Binary files /dev/null and b/web_select_all_companies/static/description/select_all_companies.gif differ diff --git a/web_select_all_companies/static/src/js/switch_all_company_menu.esm.js b/web_select_all_companies/static/src/js/switch_all_company_menu.esm.js new file mode 100644 index 000000000000..4421cbb79d91 --- /dev/null +++ b/web_select_all_companies/static/src/js/switch_all_company_menu.esm.js @@ -0,0 +1,27 @@ +/** @odoo-module **/ +/* Copyright 2023 Camptocamp - Telmo Santos + * Copyright 2024 Gumbys - Yannick Olivier + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ +import {SwitchCompanyMenu} from "@web/webclient/switch_company_menu/switch_company_menu"; +import {patch} from "@web/core/utils/patch"; + +patch(SwitchCompanyMenu.prototype, { + setup() { + super.setup(...arguments); + this.allCompanyIds = Object.values(this.companyService.allowedCompanies).map( + (x) => x.id + ); + this.isAllCompaniesSelected = this.allCompanyIds.every((elem) => + this.companySelector.selectedCompaniesIds.includes(elem) + ); + }, + + toggleSelectAllCompanies() { + var allCompanyIds = this.allCompanyIds; + if (this.isAllCompaniesSelected) { + // Deselect + allCompanyIds = this.companyService.currentCompany.id; + } + this.companyService.setCompanies(allCompanyIds, false); + }, +}); diff --git a/web_select_all_companies/static/src/xml/switch_all_company_menu.xml b/web_select_all_companies/static/src/xml/switch_all_company_menu.xml new file mode 100644 index 000000000000..345170da5b11 --- /dev/null +++ b/web_select_all_companies/static/src/xml/switch_all_company_menu.xml @@ -0,0 +1,42 @@ + + + + + + +
+
+ + + +
+
+ All Companies +
+
+
+
+
+ +