diff --git a/fix_compute_trans_implied_groups/README.rst b/fix_compute_trans_implied_groups/README.rst new file mode 100644 index 00000000000..ab7064a4bd5 --- /dev/null +++ b/fix_compute_trans_implied_groups/README.rst @@ -0,0 +1,83 @@ +==================================== +Fix trans implied groups computation +==================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7c2c1f40816d9460f2b852c46de1cdd7a4673461d1ee0638e88d00f478290ec7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github + :target: https://github.com/OCA/server-tools/tree/14.0/fix_compute_trans_implied_groups + :alt: OCA/server-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-fix_compute_trans_implied_groups + :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/server-tools&target_branch=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The computation of `res.groups.trans_implied_ids` is broken, check it by executing the following steps: +1. Install `sale` module +2. In the Odoo shell execute: `env["res.groups"].get_groups_by_application()` + +*Actual result* +`[..., (ir.module.category(52,), 'boolean', res.groups(22, 21, 20), (100, 'Other')) , ...]` + +*Expected result* +`[..., (ir.module.category(52,), 'selection', res.groups(20, 21, 22), (5, 'Sales')) , ...]` + +*Additional info* +The result of `get_groups_by_application` is correct if the computation of `res.groups.trans_implied_ids` is called executing: +`env["res.groups"].search([])._compute_trans_implied()` + +**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 +~~~~~~~ + +* PyTech + +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/server-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fix_compute_trans_implied_groups/__init__.py b/fix_compute_trans_implied_groups/__init__.py new file mode 100644 index 00000000000..31660d6a965 --- /dev/null +++ b/fix_compute_trans_implied_groups/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/fix_compute_trans_implied_groups/__manifest__.py b/fix_compute_trans_implied_groups/__manifest__.py new file mode 100644 index 00000000000..18f93454574 --- /dev/null +++ b/fix_compute_trans_implied_groups/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2025 Simone Rubino - PyTech +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Fix trans implied groups computation", + "summary": "Fix transitively implied groups computation", + "version": "14.0.1.0.0", + "author": "PyTech, Odoo Community Association (OCA)", + "category": "Tools", + "license": "AGPL-3", + "website": "https://github.com/OCA/server-tools", + "depends": [ + "base", + ], +} diff --git a/fix_compute_trans_implied_groups/models/__init__.py b/fix_compute_trans_implied_groups/models/__init__.py new file mode 100644 index 00000000000..1d483ba26ea --- /dev/null +++ b/fix_compute_trans_implied_groups/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import res_groups diff --git a/fix_compute_trans_implied_groups/models/res_groups.py b/fix_compute_trans_implied_groups/models/res_groups.py new file mode 100644 index 00000000000..4e28d285eeb --- /dev/null +++ b/fix_compute_trans_implied_groups/models/res_groups.py @@ -0,0 +1,12 @@ +# Copyright 2025 Simone Rubino - PyTech +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResGroups(models.Model): + _inherit = "res.groups" + + trans_implied_ids = fields.Many2many( + recursive=True, + ) diff --git a/fix_compute_trans_implied_groups/readme/DESCRIPTION.rst b/fix_compute_trans_implied_groups/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..cd6bef50a13 --- /dev/null +++ b/fix_compute_trans_implied_groups/readme/DESCRIPTION.rst @@ -0,0 +1,13 @@ +The computation of `res.groups.trans_implied_ids` is broken, check it by executing the following steps: +1. Install `sale` module +2. In the Odoo shell execute: `env["res.groups"].get_groups_by_application()` + +*Actual result* +`[..., (ir.module.category(52,), 'boolean', res.groups(22, 21, 20), (100, 'Other')) , ...]` + +*Expected result* +`[..., (ir.module.category(52,), 'selection', res.groups(20, 21, 22), (5, 'Sales')) , ...]` + +*Additional info* +The result of `get_groups_by_application` is correct if the computation of `res.groups.trans_implied_ids` is called executing: +`env["res.groups"].search([])._compute_trans_implied()` diff --git a/fix_compute_trans_implied_groups/static/description/index.html b/fix_compute_trans_implied_groups/static/description/index.html new file mode 100644 index 00000000000..60263358d3c --- /dev/null +++ b/fix_compute_trans_implied_groups/static/description/index.html @@ -0,0 +1,425 @@ + + + + + +Fix trans implied groups computation + + + +
+

Fix trans implied groups computation

+ + +

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

+

The computation of res.groups.trans_implied_ids is broken, check it by executing the following steps: +1. Install sale module +2. In the Odoo shell execute: env[“res.groups”].get_groups_by_application()

+

Actual result +[…, (ir.module.category(52,), ‘boolean’, res.groups(22, 21, 20), (100, ‘Other’)) , …]

+

Expected result +[…, (ir.module.category(52,), ‘selection’, res.groups(20, 21, 22), (5, ‘Sales’)) , …]

+

Additional info +The result of get_groups_by_application is correct if the computation of res.groups.trans_implied_ids is called executing: +env[“res.groups”].search([])._compute_trans_implied()

+

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

+
    +
  • PyTech
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/setup/fix_compute_trans_implied_groups/odoo/addons/fix_compute_trans_implied_groups b/setup/fix_compute_trans_implied_groups/odoo/addons/fix_compute_trans_implied_groups new file mode 120000 index 00000000000..8cc54cde8de --- /dev/null +++ b/setup/fix_compute_trans_implied_groups/odoo/addons/fix_compute_trans_implied_groups @@ -0,0 +1 @@ +../../../../fix_compute_trans_implied_groups \ No newline at end of file diff --git a/setup/fix_compute_trans_implied_groups/setup.py b/setup/fix_compute_trans_implied_groups/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/fix_compute_trans_implied_groups/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)