Skip to content

Commit

Permalink
[16][MIG] stock_multi_warehouse_security
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-dacosta committed Jan 29, 2024
1 parent cdbdeba commit 49e2738
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 37 deletions.
9 changes: 4 additions & 5 deletions stock_multi_warehouse_security/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -96,6 +93,8 @@ Contributors

* Pierre Verkest <[email protected]>

* Florian da Costa <[email protected]>

Maintainers
~~~~~~~~~~~

Expand Down
4 changes: 1 addition & 3 deletions stock_multi_warehouse_security/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand All @@ -13,8 +13,6 @@
"installable": True,
"summary": "Restrict user access in multi-warehouse environment",
"depends": [
"stock",
"stock_location_warehouse",
"stock_warehouse_relationship",
],
"data": [
Expand Down
2 changes: 2 additions & 0 deletions stock_multi_warehouse_security/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* `Foodles <https://www.foodles.co>`_

* Pierre Verkest <[email protected]>

* Florian da Costa <[email protected]>
3 changes: 0 additions & 3 deletions stock_multi_warehouse_security/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion stock_multi_warehouse_security/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 0 additions & 16 deletions stock_multi_warehouse_security/security/stock_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,4 @@
<field eval="1" name="perm_create" />
</record>

<!--
<record id="ir_rule_stock_inventory_allowed_warehouse" model="ir.rule">
<field name="name">Stock Inventories from allowed Warehouse</field>
<field name="model_id" ref="stock.model_stock_inventory"/>
<field name="domain_force">['|',('warehouse_id', '=', False), '|', ('warehouse_id', 'in', user.warehouse_ids.ids), (1 if user.warehouse_ids.ids == [] else 0, "=", 1)]</field>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>
-->

</odoo>
9 changes: 4 additions & 5 deletions stock_multi_warehouse_security/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Stock Multi-Warehouse Security</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9f4135f0982c8672784ff045a7e04ed1851fe4d2c3abba3c6598088120fc0d6c
!! source digest: sha256:c73576fd246ea4c2162f73206b3ea653501d8f8042e2aebde833d45bac149eca
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_multi_warehouse_security"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_multi_warehouse_security"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>With this module you are able to set a restricted list
Expand Down Expand Up @@ -404,15 +404,12 @@ <h1 class="title">Stock Multi-Warehouse Security</h1>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>On each user administrators is able to defined allowed warehouse.</p>
<p>Each user administrators is able to defined allowed warehouse.</p>
<p>No warehouse define in such list means no restrictions.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>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.</li>
<li>test make sure default warehouse can still be set if user also
sales goods but processus is not unit-tested</li>
<li>Add unitest test to ensure transit goods between warehouses
Expand Down Expand Up @@ -446,6 +443,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</ul>
</blockquote>
</li>
<li><p class="first">Florian da Costa &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</p>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
4 changes: 2 additions & 2 deletions stock_multi_warehouse_security/tests/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from decorator import decorator

from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase


def allowed_companies():
Expand Down Expand Up @@ -51,7 +51,7 @@ def wrapper(func, *args, **kwargs):
return wrapper


class TestStockCommon(SavepointCase):
class TestStockCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 49e2738

Please sign in to comment.