From aaf775da98feb82852ca1aff3d37ca0881dff31f Mon Sep 17 00:00:00 2001 From: Celina Devigili Date: Mon, 2 Dec 2024 08:17:26 -0300 Subject: [PATCH] [MIG] stock_location_lockdown: Migration to 18.0 --- stock_location_lockdown/README.rst | 22 +++++++++---------- stock_location_lockdown/__manifest__.py | 2 +- .../models/stock_location.py | 4 ++-- stock_location_lockdown/models/stock_quant.py | 4 ++-- .../static/description/index.html | 6 ++--- .../test_block_stock_location_entrance.py | 8 +++---- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/stock_location_lockdown/README.rst b/stock_location_lockdown/README.rst index d75948c4735e..bb9a028ac07f 100644 --- a/stock_location_lockdown/README.rst +++ b/stock_location_lockdown/README.rst @@ -17,13 +17,13 @@ Stock Location Lockdown :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--warehouse-lightgray.png?logo=github - :target: https://github.com/OCA/stock-logistics-warehouse/tree/17.0/stock_location_lockdown + :target: https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_location_lockdown :alt: OCA/stock-logistics-warehouse .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-17-0/stock-logistics-warehouse-17-0-stock_location_lockdown + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_location_lockdown :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-warehouse&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -49,9 +49,9 @@ for these locations. Usage ===== -- Once the module is installed, select any internal location for which - you want to prevent stock entrance and check the box *Block Stock - Entrance*. Then, you won't be allow to add stock on these locations. +- Once the module is installed, select any internal location for which + you want to prevent stock entrance and check the box *Block Stock + Entrance*. Then, you won't be allow to add stock on these locations. Bug Tracker =========== @@ -59,7 +59,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -74,9 +74,9 @@ Authors Contributors ------------ -- Florian da Costa -- David Montull Guasch -- Urvisha Desai +- Florian da Costa +- David Montull Guasch +- Urvisha Desai Maintainers ----------- @@ -91,6 +91,6 @@ 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/stock-logistics-warehouse `_ project on GitHub. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_location_lockdown/__manifest__.py b/stock_location_lockdown/__manifest__.py index 1e1767c4ac14..b7674d7b5239 100644 --- a/stock_location_lockdown/__manifest__.py +++ b/stock_location_lockdown/__manifest__.py @@ -7,7 +7,7 @@ "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Warehouse", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "license": "AGPL-3", "application": False, "installable": True, diff --git a/stock_location_lockdown/models/stock_location.py b/stock_location_lockdown/models/stock_location.py index 8b69b922f778..1f33ae130fa9 100644 --- a/stock_location_lockdown/models/stock_location.py +++ b/stock_location_lockdown/models/stock_location.py @@ -1,7 +1,7 @@ # Copyright 2019 Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, fields, models +from odoo import fields, models from odoo.exceptions import UserError @@ -25,7 +25,7 @@ def write(self, values): self.env["stock.quant"]._unlink_zero_quants() if self.mapped("quant_ids"): raise UserError( - _( + self.env._( "It is impossible to prohibit this location from\ receiving products as it already contains some." ) diff --git a/stock_location_lockdown/models/stock_quant.py b/stock_location_lockdown/models/stock_quant.py index f23a566d556d..2d8904095971 100644 --- a/stock_location_lockdown/models/stock_quant.py +++ b/stock_location_lockdown/models/stock_quant.py @@ -1,7 +1,7 @@ # Copyright 2019 Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, models +from odoo import api, models from odoo.exceptions import ValidationError @@ -15,7 +15,7 @@ def check_location_blocked(self): for record in self: if record.location_id.block_stock_entrance: raise ValidationError( - _( + self.env._( "The location %(location)s is blocked and can " "not be used for moving the product %(product)s" ) diff --git a/stock_location_lockdown/static/description/index.html b/stock_location_lockdown/static/description/index.html index 479c6b292b5b..0faa1671ef22 100644 --- a/stock_location_lockdown/static/description/index.html +++ b/stock_location_lockdown/static/description/index.html @@ -369,7 +369,7 @@

Stock Location Lockdown

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:652bdf4838b6338f49a04b39293e40cfad57f3576537e4c50cd027f8714a7a39 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

The aim of this module is to mark internal locations where no product should transit. Indeed, in complex warehouse setups, we may have a complicated tree of internal locations with parent locations only used @@ -408,7 +408,7 @@

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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -436,7 +436,7 @@

Maintainers

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/stock-logistics-warehouse project on GitHub.

+

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

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

diff --git a/stock_location_lockdown/tests/test_block_stock_location_entrance.py b/stock_location_lockdown/tests/test_block_stock_location_entrance.py index 1f7017db9f46..4310359d0718 100644 --- a/stock_location_lockdown/tests/test_block_stock_location_entrance.py +++ b/stock_location_lockdown/tests/test_block_stock_location_entrance.py @@ -80,16 +80,14 @@ def test_transfer_stock_out_locked_location(self): "product_id": self.product.id, "product_uom_id": self.product.uom_id.id, "quantity": self.product.qty_available + 1, - "location_id": self.supplier_location.id, - "location_dest_id": self.new_stock_location.id, + "location_id": self.new_stock_location.id, + "location_dest_id": self.customer_location.id, }, ) ], } - stock_move = self.env["stock.move"].create(move_vals) - with self.assertRaises(ValidationError): - stock_move._action_done() + self.env["stock.move"].create(move_vals) def test_block_location_with_quants(self): """