From 49e2738edbce035b78a8551ee08be8a3fff1da05 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Mon, 29 Jan 2024 16:38:57 +0100 Subject: [PATCH] [16][MIG] stock_multi_warehouse_security --- stock_multi_warehouse_security/README.rst | 9 ++++----- stock_multi_warehouse_security/__manifest__.py | 4 +--- .../readme/CONTRIBUTORS.rst | 2 ++ .../readme/ROADMAP.rst | 3 --- stock_multi_warehouse_security/readme/USAGE.rst | 2 +- .../security/stock_security.xml | 16 ---------------- .../static/description/index.html | 9 ++++----- stock_multi_warehouse_security/tests/common.py | 4 ++-- .../test_stock_multi_warehouse_security_rules.py | 4 ++-- 9 files changed, 16 insertions(+), 37 deletions(-) diff --git a/stock_multi_warehouse_security/README.rst b/stock_multi_warehouse_security/README.rst index 260c62854e52..8a41d2ff084c 100644 --- a/stock_multi_warehouse_security/README.rst +++ b/stock_multi_warehouse_security/README.rst @@ -7,7 +7,7 @@ Stock Multi-Warehouse Security !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:9f4135f0982c8672784ff045a7e04ed1851fe4d2c3abba3c6598088120fc0d6c + !! source digest: sha256:c73576fd246ea4c2162f73206b3ea653501d8f8042e2aebde833d45bac149eca !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png @@ -55,16 +55,13 @@ on version 12.0 but has some key differences on user experience: Usage ===== -On each user administrators is able to defined allowed warehouse. +Each user administrators is able to defined allowed warehouse. No warehouse define in such list means no restrictions. Known issues / Roadmap ====================== -* link somehow inventory to a given warehouse or a list of warehouses - and decide who is able to see which inventories. We probably - don't wan't always the same behaviour according business. * test make sure default warehouse can still be set if user also sales goods but processus is not unit-tested * Add unitest test to ensure transit goods between warehouses @@ -96,6 +93,8 @@ Contributors * Pierre Verkest +* Florian da Costa + Maintainers ~~~~~~~~~~~ diff --git a/stock_multi_warehouse_security/__manifest__.py b/stock_multi_warehouse_security/__manifest__.py index f0a8f73ae124..e71c2a818d27 100644 --- a/stock_multi_warehouse_security/__manifest__.py +++ b/stock_multi_warehouse_security/__manifest__.py @@ -4,7 +4,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Stock Multi-Warehouse Security", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "category": "Warehouse Management", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Akretion, Pierre Verkest, Odoo Community Association (OCA)", @@ -13,8 +13,6 @@ "installable": True, "summary": "Restrict user access in multi-warehouse environment", "depends": [ - "stock", - "stock_location_warehouse", "stock_warehouse_relationship", ], "data": [ diff --git a/stock_multi_warehouse_security/readme/CONTRIBUTORS.rst b/stock_multi_warehouse_security/readme/CONTRIBUTORS.rst index c33fa7d72b5a..7ab46a8a8d4e 100644 --- a/stock_multi_warehouse_security/readme/CONTRIBUTORS.rst +++ b/stock_multi_warehouse_security/readme/CONTRIBUTORS.rst @@ -1,3 +1,5 @@ * `Foodles `_ * Pierre Verkest + +* Florian da Costa diff --git a/stock_multi_warehouse_security/readme/ROADMAP.rst b/stock_multi_warehouse_security/readme/ROADMAP.rst index f773052eb36a..84eed560b9bf 100644 --- a/stock_multi_warehouse_security/readme/ROADMAP.rst +++ b/stock_multi_warehouse_security/readme/ROADMAP.rst @@ -1,6 +1,3 @@ -* link somehow inventory to a given warehouse or a list of warehouses - and decide who is able to see which inventories. We probably - don't wan't always the same behaviour according business. * test make sure default warehouse can still be set if user also sales goods but processus is not unit-tested * Add unitest test to ensure transit goods between warehouses diff --git a/stock_multi_warehouse_security/readme/USAGE.rst b/stock_multi_warehouse_security/readme/USAGE.rst index 63fbf80fa663..44cd2dbd7128 100644 --- a/stock_multi_warehouse_security/readme/USAGE.rst +++ b/stock_multi_warehouse_security/readme/USAGE.rst @@ -1,3 +1,3 @@ -On each user administrators is able to defined allowed warehouse. +Each user administrators is able to defined allowed warehouse. No warehouse define in such list means no restrictions. diff --git a/stock_multi_warehouse_security/security/stock_security.xml b/stock_multi_warehouse_security/security/stock_security.xml index f0869ca09920..8129c3bc9d66 100644 --- a/stock_multi_warehouse_security/security/stock_security.xml +++ b/stock_multi_warehouse_security/security/stock_security.xml @@ -97,20 +97,4 @@ - - diff --git a/stock_multi_warehouse_security/static/description/index.html b/stock_multi_warehouse_security/static/description/index.html index c7b307ee785a..1343d15492b7 100644 --- a/stock_multi_warehouse_security/static/description/index.html +++ b/stock_multi_warehouse_security/static/description/index.html @@ -367,7 +367,7 @@

Stock Multi-Warehouse Security

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:9f4135f0982c8672784ff045a7e04ed1851fe4d2c3abba3c6598088120fc0d6c +!! source digest: sha256:c73576fd246ea4c2162f73206b3ea653501d8f8042e2aebde833d45bac149eca !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runboat

With this module you are able to set a restricted list @@ -404,15 +404,12 @@

Stock Multi-Warehouse Security

Usage

-

On each user administrators is able to defined allowed warehouse.

+

Each user administrators is able to defined allowed warehouse.

No warehouse define in such list means no restrictions.

Known issues / Roadmap

    -
  • link somehow inventory to a given warehouse or a list of warehouses -and decide who is able to see which inventories. We probably -don’t wan’t always the same behaviour according business.
  • test make sure default warehouse can still be set if user also sales goods but processus is not unit-tested
  • Add unitest test to ensure transit goods between warehouses @@ -446,6 +443,8 @@

    Contributors

+
  • Florian da Costa <florian.dacosta@akretion.com>

    +
  • diff --git a/stock_multi_warehouse_security/tests/common.py b/stock_multi_warehouse_security/tests/common.py index ff2f3d852901..0c52e7a369d2 100644 --- a/stock_multi_warehouse_security/tests/common.py +++ b/stock_multi_warehouse_security/tests/common.py @@ -1,6 +1,6 @@ from decorator import decorator -from odoo.tests.common import SavepointCase +from odoo.tests.common import TransactionCase def allowed_companies(): @@ -51,7 +51,7 @@ def wrapper(func, *args, **kwargs): return wrapper -class TestStockCommon(SavepointCase): +class TestStockCommon(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() diff --git a/stock_multi_warehouse_security/tests/test_stock_multi_warehouse_security_rules.py b/stock_multi_warehouse_security/tests/test_stock_multi_warehouse_security_rules.py index e05d6a705cfc..b132eb619a01 100644 --- a/stock_multi_warehouse_security/tests/test_stock_multi_warehouse_security_rules.py +++ b/stock_multi_warehouse_security/tests/test_stock_multi_warehouse_security_rules.py @@ -88,7 +88,7 @@ def test_create_and_validate_picking(self): ) picking.action_assign() self.assertEqual(picking.state, "assigned") - picking.move_lines.write({"quantity_done": 5}) + picking.move_ids.write({"quantity_done": 5}) picking.button_validate() self.assertEqual(picking.state, "done") @@ -204,7 +204,7 @@ def setUpClass(cls): cls.stock_picking_wh_1 | cls.stock_picking_wh_2 | cls.stock_picking_wh_3 ) pickings.action_assign() - pickings.move_lines.write({"quantity_done": 5}) + pickings.move_ids.write({"quantity_done": 5}) pickings.button_validate() @users(