diff --git a/stock_archive_constraint/README.rst b/stock_archive_constraint/README.rst index 3d18471de..ddf4ba45b 100644 --- a/stock_archive_constraint/README.rst +++ b/stock_archive_constraint/README.rst @@ -14,13 +14,13 @@ Stock archive constraint :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/14.0/stock_archive_constraint + :target: https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_archive_constraint :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-14-0/stock-logistics-warehouse-14-0-stock_archive_constraint + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_archive_constraint :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/153/14.0 + :target: https://runbot.odoo-community.org/runbot/153/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -45,7 +45,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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -62,8 +62,9 @@ Contributors * `Tecnativa `_: - * Carlos Daudén - * Víctor Martínez + * Carlos Daudén + * Víctor Martínez + * César A. Sánchez Maintainers ~~~~~~~~~~~ @@ -86,6 +87,6 @@ Current `maintainer `__: |maintainer-victoralmau| -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_archive_constraint/__manifest__.py b/stock_archive_constraint/__manifest__.py index 3bbd429bd..2760b5fd6 100644 --- a/stock_archive_constraint/__manifest__.py +++ b/stock_archive_constraint/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Stock archive constraint", - "version": "14.0.1.0.0", + "version": "15.0.1.0.0", "license": "AGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/stock_archive_constraint/i18n/es.po b/stock_archive_constraint/i18n/es.po index 7a95b8cc2..26e9fcbea 100644 --- a/stock_archive_constraint/i18n/es.po +++ b/stock_archive_constraint/i18n/es.po @@ -4,18 +4,17 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-08 09:03+0000\n" -"PO-Revision-Date: 2021-01-08 10:06+0100\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2022-07-27 19:55+0000\n" +"PO-Revision-Date: 2022-07-27 19:55+0000\n" +"Last-Translator: \n" "Language-Team: \n" -"Language: es\n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" +"Content-Transfer-Encoding: \n" "Plural-Forms: \n" -"X-Generator: Poedit 2.3\n" #. module: stock_archive_constraint #: model:ir.model,name:stock_archive_constraint.model_stock_location @@ -23,63 +22,63 @@ msgid "Inventory Locations" msgstr "Ubicaciones de inventario" #. module: stock_archive_constraint -#: code:addons/stock_archive_constraint/models/stock_location.py:41 +#: code:addons/stock_archive_constraint/models/stock_location.py:0 #, python-format msgid "" -"It is not possible to archive location '%s' which has associated picking " -"lines." +"It is not possible to archive location '%(display_name)s' which has " +"associated picking lines." msgstr "" -"No es posible archivar la ubicación '%s' que tiene líneas de albaranes " +"No es posible archivar la ubicación '%(display_name)s' que tiene líneas de " +"albarán asociadas." + +#. module: stock_archive_constraint +#: code:addons/stock_archive_constraint/models/stock_location.py:0 +#, python-format +msgid "" +"It is not possible to archive location '%(display_name)s' which has " +"associated stock quantities." +msgstr "" +"No es posible archivar la ubicación '%(display_name)s' que tiene cantidades " +"asociadas de stock." + +#. module: stock_archive_constraint +#: code:addons/stock_archive_constraint/models/stock_location.py:0 +#, python-format +msgid "" +"It is not possible to archive location '%(display_name)s' which has " +"associated stock reservations." +msgstr "" +"No es posible archivar la ubicación '%(display_name)s' que tiene reservas " "asociadas." #. module: stock_archive_constraint -#: code:addons/stock_archive_constraint/models/stock_location.py:24 +#: code:addons/stock_archive_constraint/models/product_product.py:0 #, python-format msgid "" -"It is not possible to archive location '%s' which has associated stock " -"quantities." +"It is not possible to archive product '%(display_name)s' which has " +"associated picking lines." msgstr "" -"No es posible archivar la ubicación '%s' que tiene asociadas cantidades " -"de stock." +"No es posible archivar el producto '%(display_name)s' que tiene lineas de " +"albarán asociadas." #. module: stock_archive_constraint -#: code:addons/stock_archive_constraint/models/stock_location.py:58 +#: code:addons/stock_archive_constraint/models/product_product.py:0 #, python-format msgid "" -"It is not possible to archive location '%s' which has associated stock " -"reservations." +"It is not possible to archive product '%(display_name)s' which has " +"associated stock quantities." msgstr "" -"No es posible archivar la ubicación '%s' que tiene reservas de stock " -"asociadas." +"No es posible archivar el producto '%(display_name)s' que tiene cantidades " +"asociadas de stock." #. module: stock_archive_constraint -#: code:addons/stock_archive_constraint/models/product_product.py:36 +#: code:addons/stock_archive_constraint/models/product_product.py:0 #, python-format msgid "" -"It is not possible to archive product '%s' which has associated picking " -"lines." +"It is not possible to archive product '%(display_name)s' which has " +"associated stock reservations." msgstr "" -"No es posible archivar el producto '%s' que tiene líneas de albaranes " -"asociadas." - -#. module: stock_archive_constraint -#: code:addons/stock_archive_constraint/models/product_product.py:22 -#, python-format -msgid "" -"It is not possible to archive product '%s' which has associated stock " -"quantities." -msgstr "" -"No es posible archivar el producto '%s' que tiene asociadas cantidades " -"de stock." - -#. module: stock_archive_constraint -#: code:addons/stock_archive_constraint/models/product_product.py:50 -#, python-format -msgid "" -"It is not possible to archive product '%s' which has associated stock " -"reservations." -msgstr "" -"No es posible archivar el producto '%s' que tiene reservas de stock " +"No es posible archivar el producto '%(display_name)s' que tiene reservas " "asociadas." #. module: stock_archive_constraint diff --git a/stock_archive_constraint/i18n/stock_archive_constraint.pot b/stock_archive_constraint/i18n/stock_archive_constraint.pot index c75e5e81e..24cf7a5fc 100644 --- a/stock_archive_constraint/i18n/stock_archive_constraint.pot +++ b/stock_archive_constraint/i18n/stock_archive_constraint.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -13,18 +13,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: stock_archive_constraint -#: model:ir.model.fields,field_description:stock_archive_constraint.field_product_product__display_name -#: model:ir.model.fields,field_description:stock_archive_constraint.field_stock_location__display_name -msgid "Display Name" -msgstr "" - -#. module: stock_archive_constraint -#: model:ir.model.fields,field_description:stock_archive_constraint.field_product_product__id -#: model:ir.model.fields,field_description:stock_archive_constraint.field_stock_location__id -msgid "ID" -msgstr "" - #. module: stock_archive_constraint #: model:ir.model,name:stock_archive_constraint.model_stock_location msgid "Inventory Locations" @@ -34,54 +22,48 @@ msgstr "" #: code:addons/stock_archive_constraint/models/stock_location.py:0 #, python-format msgid "" -"It is not possible to archive location '%s' which has associated picking " -"lines." +"It is not possible to archive location '%(display_name)s' which has " +"associated picking lines." msgstr "" #. module: stock_archive_constraint #: code:addons/stock_archive_constraint/models/stock_location.py:0 #, python-format msgid "" -"It is not possible to archive location '%s' which has associated stock " -"quantities." +"It is not possible to archive location '%(display_name)s' which has " +"associated stock quantities." msgstr "" #. module: stock_archive_constraint #: code:addons/stock_archive_constraint/models/stock_location.py:0 #, python-format msgid "" -"It is not possible to archive location '%s' which has associated stock " -"reservations." +"It is not possible to archive location '%(display_name)s' which has " +"associated stock reservations." msgstr "" #. module: stock_archive_constraint #: code:addons/stock_archive_constraint/models/product_product.py:0 #, python-format msgid "" -"It is not possible to archive product '%s' which has associated picking " -"lines." +"It is not possible to archive product '%(display_name)s' which has " +"associated picking lines." msgstr "" #. module: stock_archive_constraint #: code:addons/stock_archive_constraint/models/product_product.py:0 #, python-format msgid "" -"It is not possible to archive product '%s' which has associated stock " -"quantities." +"It is not possible to archive product '%(display_name)s' which has " +"associated stock quantities." msgstr "" #. module: stock_archive_constraint #: code:addons/stock_archive_constraint/models/product_product.py:0 #, python-format msgid "" -"It is not possible to archive product '%s' which has associated stock " -"reservations." -msgstr "" - -#. module: stock_archive_constraint -#: model:ir.model.fields,field_description:stock_archive_constraint.field_product_product____last_update -#: model:ir.model.fields,field_description:stock_archive_constraint.field_stock_location____last_update -msgid "Last Modified on" +"It is not possible to archive product '%(display_name)s' which has " +"associated stock reservations." msgstr "" #. module: stock_archive_constraint diff --git a/stock_archive_constraint/models/product_product.py b/stock_archive_constraint/models/product_product.py index d639e8c5e..7453754e1 100644 --- a/stock_archive_constraint/models/product_product.py +++ b/stock_archive_constraint/models/product_product.py @@ -21,9 +21,10 @@ class ProductProduct(models.Model): if res: raise ValidationError( _( - "It is not possible to archive product '%s' which has " - "associated stock quantities." % res[0].product_id.display_name + "It is not possible to archive product '%(display_name)s' which has " + "associated stock quantities." ) + % {"display_name": res.product_id.display_name} ) @api.constrains("active") @@ -38,9 +39,10 @@ class ProductProduct(models.Model): if res: raise ValidationError( _( - "It is not possible to archive product '%s' which has " - "associated picking lines." % res[0].product_id.display_name + "It is not possible to archive product '%(display_name)s' which has " + "associated picking lines." ) + % {"display_name": res.product_id.display_name} ) @api.constrains("active") @@ -55,7 +57,8 @@ class ProductProduct(models.Model): if res: raise ValidationError( _( - "It is not possible to archive product '%s' which has " - "associated stock reservations." % res[0].product_id.display_name + "It is not possible to archive product '%(display_name)s' which has " + "associated stock reservations." ) + % {"display_name": res.product_id.display_name} ) diff --git a/stock_archive_constraint/models/stock_location.py b/stock_archive_constraint/models/stock_location.py index 3152db12f..d78a9a18e 100644 --- a/stock_archive_constraint/models/stock_location.py +++ b/stock_archive_constraint/models/stock_location.py @@ -23,9 +23,10 @@ class StockLocation(models.Model): if res: raise ValidationError( _( - "It is not possible to archive location '%s' which has " - "associated stock quantities." % res[0].display_name + "It is not possible to archive location '%(display_name)s' which has " + "associated stock quantities." ) + % {"display_name": res.display_name} ) @api.constrains("active") @@ -43,9 +44,10 @@ class StockLocation(models.Model): if res: raise ValidationError( _( - "It is not possible to archive location '%s' which has " - "associated picking lines." % res[0].display_name + "It is not possible to archive location '%(display_name)s' which has " + "associated picking lines." ) + % {"display_name": res.display_name} ) @api.constrains("active") @@ -63,7 +65,8 @@ class StockLocation(models.Model): if res: raise ValidationError( _( - "It is not possible to archive location '%s' which has " - "associated stock reservations." % res[0].display_name + "It is not possible to archive location '%(display_name)s' which has " + "associated stock reservations." ) + % {"display_name": res.display_name} ) diff --git a/stock_archive_constraint/readme/CONTRIBUTORS.rst b/stock_archive_constraint/readme/CONTRIBUTORS.rst index 48848770a..7c20a15bf 100644 --- a/stock_archive_constraint/readme/CONTRIBUTORS.rst +++ b/stock_archive_constraint/readme/CONTRIBUTORS.rst @@ -1,4 +1,5 @@ * `Tecnativa `_: - * Carlos Daudén - * Víctor Martínez + * Carlos Daudén + * Víctor Martínez + * César A. Sánchez diff --git a/stock_archive_constraint/static/description/index.html b/stock_archive_constraint/static/description/index.html index 96ba2196c..6f370933f 100644 --- a/stock_archive_constraint/static/description/index.html +++ b/stock_archive_constraint/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

Production/Stable License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

Allows to block archiving products with associated stock.quant or stock.move. Allows to block archiving locations with associated stock.quant or stock.move.

Table of contents

@@ -395,7 +395,7 @@ Allows to block archiving locations with associated stock.quant or stock.move.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 smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -408,16 +408,16 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Contributors

-

Maintainers

@@ -428,7 +428,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

victoralmau

-

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_archive_constraint/tests/test_location_archive_constraint.py b/stock_archive_constraint/tests/test_location_archive_constraint.py index 9b1f25dbb..c2708f17a 100644 --- a/stock_archive_constraint/tests/test_location_archive_constraint.py +++ b/stock_archive_constraint/tests/test_location_archive_constraint.py @@ -2,10 +2,10 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo.exceptions import ValidationError -from odoo.tests.common import Form, SavepointCase +from odoo.tests.common import Form, TransactionCase -class TestLocationArchiveConstraint(SavepointCase): +class TestLocationArchiveConstraint(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() @@ -24,7 +24,7 @@ class TestLocationArchiveConstraint(SavepointCase): def _create_product(self, name): product_form = Form(self.env["product.product"]) product_form.name = name - product_form.type = "product" + product_form.detailed_type = "product" return product_form.save() def _create_stock_location(self, name):