diff --git a/setup/stock_reporting_access/odoo/addons/stock_reporting_access b/setup/stock_reporting_access/odoo/addons/stock_reporting_access new file mode 120000 index 00000000..3715e2a0 --- /dev/null +++ b/setup/stock_reporting_access/odoo/addons/stock_reporting_access @@ -0,0 +1 @@ +../../../../stock_reporting_access \ No newline at end of file diff --git a/setup/stock_reporting_access/setup.py b/setup/stock_reporting_access/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/stock_reporting_access/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_reporting_access/README.rst b/stock_reporting_access/README.rst new file mode 100644 index 00000000..eb7e0163 --- /dev/null +++ b/stock_reporting_access/README.rst @@ -0,0 +1,116 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +====================== +Stock Reporting Access +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:6452365b6aa0d67dd2f93ef86235161425696daea8ed78738012605b81067b52 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fstock--logistics--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_reporting_access + :alt: OCA/stock-logistics-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_reporting_access + :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/stock-logistics-workflow&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a new security group "Inventory Reporting Access" that grants +access to the Inventory > Reporting menu. + +By default, only users with the Inventory Administrator role can access the +Reporting menu. This module allows you to grant reporting access to regular +Inventory Users without giving them full administrator privileges. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +#. Go to *Settings > Users & Companies > Groups* +#. Search for "Inventory Reporting Access" +#. Add users who should have access to inventory reporting to this group + +The ``stock.valuation.layer`` model is restricted to Inventory Managers by +default. If ``stock_account`` is installed, the access rights for +``stock.valuation.layer`` should be added manually as necessary: + +#. Go to *Settings > Technical > Models* +#. Search for ``stock.valuation.layer`` +#. Open the model and go to the Access Rights tab +#. Add read-only permission for the "Inventory Reporting Access" group + +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 +~~~~~~~ + +* Quartile + +Contributors +~~~~~~~~~~~~ + +* `Quartile `__: + + * Aung Ko Ko Lin + +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. + +.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px + :target: https://github.com/yostashiro + :alt: yostashiro +.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px + :target: https://github.com/aungkokolin1997 + :alt: aungkokolin1997 + +Current `maintainers `__: + +|maintainer-yostashiro| |maintainer-aungkokolin1997| + +This module is part of the `OCA/stock-logistics-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_reporting_access/__init__.py b/stock_reporting_access/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/stock_reporting_access/__manifest__.py b/stock_reporting_access/__manifest__.py new file mode 100644 index 00000000..f1ea0b7a --- /dev/null +++ b/stock_reporting_access/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Stock Reporting Access", + "summary": "Add a security group for inventory reporting access", + "version": "16.0.1.0.0", + "category": "Inventory", + "license": "AGPL-3", + "author": "Quartile, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-workflow", + "depends": ["stock"], + "data": [ + "security/security.xml", + "views/stock_menu_views.xml", + ], + "maintainers": ["yostashiro", "aungkokolin1997"], + "installable": True, +} diff --git a/stock_reporting_access/i18n/ja.po b/stock_reporting_access/i18n/ja.po new file mode 100644 index 00000000..95a257b5 --- /dev/null +++ b/stock_reporting_access/i18n/ja.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_reporting_access +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-07-24 01:52+0000\n" +"PO-Revision-Date: 2026-07-24 01:52+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: stock_reporting_access +#: model:res.groups,name:stock_reporting_access.group_stock_reporting_user +msgid "Inventory Reporting Access" +msgstr "在庫レポーティングアクセス" diff --git a/stock_reporting_access/pyproject.toml b/stock_reporting_access/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/stock_reporting_access/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_reporting_access/readme/CONFIGURE.rst b/stock_reporting_access/readme/CONFIGURE.rst new file mode 100644 index 00000000..eb03ee37 --- /dev/null +++ b/stock_reporting_access/readme/CONFIGURE.rst @@ -0,0 +1,14 @@ +To configure this module, you need to: + +#. Go to *Settings > Users & Companies > Groups* +#. Search for "Inventory Reporting Access" +#. Add users who should have access to inventory reporting to this group + +The ``stock.valuation.layer`` model is restricted to Inventory Managers by +default. If ``stock_account`` is installed, the access rights for +``stock.valuation.layer`` should be added manually as necessary: + +#. Go to *Settings > Technical > Models* +#. Search for ``stock.valuation.layer`` +#. Open the model and go to the Access Rights tab +#. Add read-only permission for the "Inventory Reporting Access" group diff --git a/stock_reporting_access/readme/CONTRIBUTORS.rst b/stock_reporting_access/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..cd4e44ca --- /dev/null +++ b/stock_reporting_access/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Quartile `__: + + * Aung Ko Ko Lin diff --git a/stock_reporting_access/readme/DESCRIPTION.rst b/stock_reporting_access/readme/DESCRIPTION.rst new file mode 100644 index 00000000..3a7ad89a --- /dev/null +++ b/stock_reporting_access/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module adds a new security group "Inventory Reporting Access" that grants +access to the Inventory > Reporting menu. + +By default, only users with the Inventory Administrator role can access the +Reporting menu. This module allows you to grant reporting access to regular +Inventory Users without giving them full administrator privileges. diff --git a/stock_reporting_access/security/security.xml b/stock_reporting_access/security/security.xml new file mode 100644 index 00000000..b78822d7 --- /dev/null +++ b/stock_reporting_access/security/security.xml @@ -0,0 +1,11 @@ + + + + Inventory Reporting Access + + + + diff --git a/stock_reporting_access/static/description/index.html b/stock_reporting_access/static/description/index.html new file mode 100644 index 00000000..71e82f41 --- /dev/null +++ b/stock_reporting_access/static/description/index.html @@ -0,0 +1,457 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Stock Reporting Access

+ +

Beta License: AGPL-3 OCA/stock-logistics-workflow Translate me on Weblate Try me on Runboat

+

This module adds a new security group “Inventory Reporting Access” that grants +access to the Inventory > Reporting menu.

+

By default, only users with the Inventory Administrator role can access the +Reporting menu. This module allows you to grant reporting access to regular +Inventory Users without giving them full administrator privileges.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Go to Settings > Users & Companies > Groups
  2. +
  3. Search for “Inventory Reporting Access”
  4. +
  5. Add users who should have access to inventory reporting to this group
  6. +
+

The stock.valuation.layer model is restricted to Inventory Managers by +default. If stock_account is installed, the access rights for +stock.valuation.layer should be added manually as necessary:

+
    +
  1. Go to Settings > Technical > Models
  2. +
  3. Search for stock.valuation.layer
  4. +
  5. Open the model and go to the Access Rights tab
  6. +
  7. Add read-only permission for the “Inventory Reporting Access” group
  8. +
+
+
+

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

+
    +
  • Quartile
  • +
+
+
+

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.

+

Current maintainers:

+

yostashiro aungkokolin1997

+

This module is part of the OCA/stock-logistics-workflow project on GitHub.

+

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

+
+
+
+
+ + diff --git a/stock_reporting_access/tests/__init__.py b/stock_reporting_access/tests/__init__.py new file mode 100644 index 00000000..2c1910f4 --- /dev/null +++ b/stock_reporting_access/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_reporting_access diff --git a/stock_reporting_access/tests/test_stock_reporting_access.py b/stock_reporting_access/tests/test_stock_reporting_access.py new file mode 100644 index 00000000..2002a1b2 --- /dev/null +++ b/stock_reporting_access/tests/test_stock_reporting_access.py @@ -0,0 +1,58 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import Command +from odoo.tests import tagged +from odoo.tests.common import TransactionCase + + +@tagged("post_install", "-at_install") +class TestStockReportingAccess(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.group_stock_user = cls.env.ref("stock.group_stock_user") + cls.group_stock_manager = cls.env.ref("stock.group_stock_manager") + cls.group_reporting = cls.env.ref( + "stock_reporting_access.group_stock_reporting_user" + ) + cls.reporting_menu = cls.env.ref("stock.menu_warehouse_report") + cls.user_reporting = cls.env["res.users"].create( + { + "name": "Test Reporting User", + "login": "test_reporting_user", + "groups_id": [Command.set([cls.group_reporting.id])], + } + ) + cls.user_stock_only = cls.env["res.users"].create( + { + "name": "Test Stock User", + "login": "test_stock_user", + "groups_id": [Command.set([cls.group_stock_user.id])], + } + ) + + def test_reporting_menu_groups(self): + menu_groups = self.reporting_menu.groups_id + self.assertIn(self.group_reporting, menu_groups) + self.assertIn(self.group_stock_manager, menu_groups) + + def test_user_reporting_can_access_menu(self): + visible = ( + self.env["ir.ui.menu"].with_user(self.user_reporting)._visible_menu_ids() + ) + self.assertIn( + self.reporting_menu.id, + visible, + "User with reporting group should access reporting menu", + ) + + def test_user_stock_only_cannot_access_menu(self): + visible = ( + self.env["ir.ui.menu"].with_user(self.user_stock_only)._visible_menu_ids() + ) + self.assertNotIn( + self.reporting_menu.id, + visible, + "User with only stock user group should not access menu", + ) diff --git a/stock_reporting_access/views/stock_menu_views.xml b/stock_reporting_access/views/stock_menu_views.xml new file mode 100644 index 00000000..bca17e13 --- /dev/null +++ b/stock_reporting_access/views/stock_menu_views.xml @@ -0,0 +1,9 @@ + + + + + +