From 1fd63ee4d3fb6a6063873bc1f48ca5b3d1e2b85e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 16 Jun 2023 16:57:35 +0200 Subject: [PATCH] [FIX] stock_inventory_discrepancy: Ensure active_ids value Steps to reproduce: - Enter a product. - Navigate to stock on hand. - Adjust quantity and rebase discrepancy limit. - Accept the discrepancy popup. You get an error as the ID to be tried to adjust is the product one, not the quant one. We need to overwrite active_ids context with the quant IDs to be handled on the wizard popup. TT43947 stock_inventory_discrepancy 15.0.1.0.1 Translated using Weblate (Spanish) Currently translated at 100.0% (31 of 31 strings) Translation: stock-logistics-warehouse-15.0/stock-logistics-warehouse-15.0-stock_inventory_discrepancy Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_inventory_discrepancy/es/ [UPD] README.rst --- stock_inventory_discrepancy/README.rst | 15 ++-- stock_inventory_discrepancy/__manifest__.py | 2 +- stock_inventory_discrepancy/i18n/es.po | 72 ++++++++++++------- .../models/stock_quant.py | 1 + .../static/description/index.html | 42 +++++------ 5 files changed, 79 insertions(+), 53 deletions(-) diff --git a/stock_inventory_discrepancy/README.rst b/stock_inventory_discrepancy/README.rst index 5c7a87751..ac8a57259 100644 --- a/stock_inventory_discrepancy/README.rst +++ b/stock_inventory_discrepancy/README.rst @@ -2,10 +2,13 @@ Stock Inventory Discrepancy =========================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:0efdc09fe825f32b12c7add6f17e5a2d37dc61eb02dbbfe7fb521868339981ae + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Stock Inventory Discrepancy .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_inventory_discrepancy :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/15.0 - :alt: Try me on Runbot +.. |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=15.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| Adds the capability to show the discrepancy of every line in an inventory and to block the inventory validation (setting it as 'Pending to Approve') when the @@ -65,7 +68,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 +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. diff --git a/stock_inventory_discrepancy/__manifest__.py b/stock_inventory_discrepancy/__manifest__.py index 19a8ecbf5..b6eec0fd6 100644 --- a/stock_inventory_discrepancy/__manifest__.py +++ b/stock_inventory_discrepancy/__manifest__.py @@ -5,7 +5,7 @@ "summary": "Adds the capability to show the discrepancy of every line in " "an inventory and to block the inventory validation when the " "discrepancy is over a user defined threshold.", - "version": "15.0.1.0.0", + "version": "15.0.1.0.1", "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Warehouse", diff --git a/stock_inventory_discrepancy/i18n/es.po b/stock_inventory_discrepancy/i18n/es.po index 8b5a54d3f..1311f9333 100644 --- a/stock_inventory_discrepancy/i18n/es.po +++ b/stock_inventory_discrepancy/i18n/es.po @@ -9,101 +9,102 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-11-30 03:53+0000\n" -"PO-Revision-Date: 2017-11-30 03:53+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2023-07-26 22:10+0000\n" +"Last-Translator: Ivorra78 \n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" #. module: stock_inventory_discrepancy #: model_terms:ir.ui.view,arch_db:stock_inventory_discrepancy.confirm_discrepancy_wizard msgid "Apply" -msgstr "" +msgstr "Aplicar" #. module: stock_inventory_discrepancy #: model_terms:ir.ui.view,arch_db:stock_inventory_discrepancy.confirm_discrepancy_wizard msgid "Cancel" -msgstr "" +msgstr "Cancelar" #. module: stock_inventory_discrepancy #: model:ir.model,name:stock_inventory_discrepancy.model_confirm_discrepancy_wiz msgid "Confim discrepancy wizard" -msgstr "" +msgstr "Asistente de discrepancias de Confim" #. module: stock_inventory_discrepancy #: model:ir.actions.act_window,name:stock_inventory_discrepancy.confirm_discrepancy_action msgid "Confirm discrepancy" -msgstr "" +msgstr "Confirmar discrepancia" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__create_uid msgid "Created by" -msgstr "" +msgstr "Creado por" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__create_date msgid "Created on" -msgstr "" +msgstr "Creado el" #. module: stock_inventory_discrepancy #: model_terms:ir.ui.view,arch_db:stock_inventory_discrepancy.confirm_discrepancy_wizard msgid "Dates does not match" -msgstr "" +msgstr "Las fechas no coinciden" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__discrepancy_quant_ids msgid "Discrepancy Quant" -msgstr "" +msgstr "Cuantía de la discrepancia" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_quant__discrepancy_percent msgid "Discrepancy percent (%)" -msgstr "" +msgstr "Porcentaje de discrepancia (%)" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__display_name msgid "Display Name" -msgstr "" +msgstr "Nombre a Mostrar" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_quant__has_over_discrepancy msgid "Has Over Discrepancy" -msgstr "" +msgstr "Tiene más discrepancia" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__id msgid "ID" -msgstr "" +msgstr "ID (identificación)" #. module: stock_inventory_discrepancy #: model:ir.model,name:stock_inventory_discrepancy.model_stock_location msgid "Inventory Locations" -msgstr "" +msgstr "Localizaciones de Inventario" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz____last_update msgid "Last Modified on" -msgstr "" +msgstr "Última Modificación el" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__write_uid msgid "Last Updated by" -msgstr "" +msgstr "Actualizado por última vez por" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_confirm_discrepancy_wiz__write_date msgid "Last Updated on" -msgstr "" +msgstr "Última Actualización el" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location__discrepancy_threshold #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_warehouse__discrepancy_threshold #: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_quant__discrepancy_threshold msgid "Maximum Discrepancy Rate Threshold" -msgstr "" +msgstr "Umbral máximo de tasa de discrepancia" #. module: stock_inventory_discrepancy #: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_warehouse__discrepancy_threshold @@ -111,6 +112,9 @@ msgid "" "Maximum Discrepancy Rate allowed for any product when doing an Inventory " "Adjustment. Threshold defined in involved Location has preference." msgstr "" +"Tasa de Discrepancia Máxima permitida para cualquier producto al hacer un " +"Ajuste de Inventario. El umbral definido en la Ubicación implicada tiene " +"preferencia." #. module: stock_inventory_discrepancy #: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_location__discrepancy_threshold @@ -119,32 +123,38 @@ msgid "" "Adjustment. Thresholds defined in Locations have preference over Warehouse's " "ones." msgstr "" +"Tasa de Discrepancia Máxima permitida para cualquier producto al hacer un " +"Ajuste de Inventario. Los umbrales definidos en Ubicaciones tienen " +"preferencia sobre los del Almacén." #. module: stock_inventory_discrepancy #: code:addons/stock_inventory_discrepancy/hooks.py:0 #, python-format msgid "Only a stock manager can validate an inventory adjustment." -msgstr "" +msgstr "Sólo un gestor de existencias puede validar un ajuste de inventario." #. module: stock_inventory_discrepancy #: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_location__propagate_discrepancy_threshold msgid "Propagate Maximum Discrepancy Rate Threshold to child locations" msgstr "" +"Propagar el umbral de tasa de discrepancia máxima a las ubicaciones " +"secundarias" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location__propagate_discrepancy_threshold msgid "Propagate discrepancy threshold" -msgstr "" +msgstr "Propagar el umbral de discrepancia" #. module: stock_inventory_discrepancy #: model:ir.model,name:stock_inventory_discrepancy.model_stock_quant msgid "Quants" -msgstr "" +msgstr "Cantidades" #. module: stock_inventory_discrepancy #: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_quant__discrepancy_percent msgid "The discrepancy expressed in percent with theoretical quantity as basis" msgstr "" +"La discrepancia expresada en porcentaje con la cantidad teórica como base" #. module: stock_inventory_discrepancy #: model_terms:ir.ui.view,arch_db:stock_inventory_discrepancy.confirm_discrepancy_wizard @@ -152,21 +162,23 @@ msgid "" "The following products have exceeded the discrepancy threshold.\n" " Are you sure you want to proceed?" msgstr "" +"Los siguientes productos han superado el umbral de discrepancia.\n" +" Está seguro de que desea continuar?" #. module: stock_inventory_discrepancy #: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_quant__discrepancy_threshold msgid "Threshold (%)" -msgstr "" +msgstr "Umbral (%)" #. module: stock_inventory_discrepancy #: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation msgid "Validate Inventory Adjustments" -msgstr "" +msgstr "Validar los ajustes de inventario" #. module: stock_inventory_discrepancy #: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation_always msgid "Validate Inventory Adjustments excceded threshold" -msgstr "" +msgstr "Validar Ajustes de Inventario umbral superado" #. module: stock_inventory_discrepancy #: model:ir.model,name:stock_inventory_discrepancy.model_stock_warehouse @@ -180,6 +192,9 @@ msgid "" "You cannot apply inventory adjustments if there are products that exceed the " "discrepancy threshold. Only users with rights to apply them can proceed." msgstr "" +"No se pueden aplicar ajustes de inventario si hay productos que superan el " +"umbral de discrepancia. Sólo los usuarios con derechos para aplicarlos " +"pueden proceder." #. module: stock_inventory_discrepancy #: model_terms:ir.ui.view,arch_db:stock_inventory_discrepancy.confirm_discrepancy_wizard @@ -189,6 +204,11 @@ msgid "" "threshold.\n" " Only users with permissions to apply them can proceed." msgstr "" +"No se puede confirmar el ajuste de inventario,\n" +" los siguientes productos han superado el umbral de " +"discrepancia.\n" +" Sólo los usuarios con permisos para aplicarlos pueden " +"proceder." #~ msgid "Inventory" #~ msgstr "Inventario" diff --git a/stock_inventory_discrepancy/models/stock_quant.py b/stock_inventory_discrepancy/models/stock_quant.py index 8659eb206..7ec8ef851 100644 --- a/stock_inventory_discrepancy/models/stock_quant.py +++ b/stock_inventory_discrepancy/models/stock_quant.py @@ -63,6 +63,7 @@ class StockQuant(models.Model): action["context"] = dict( self._context.copy(), discrepancy_quant_ids=over_discrepancy.ids, + active_ids=self.ids, ) return action return super().action_apply_inventory() diff --git a/stock_inventory_discrepancy/static/description/index.html b/stock_inventory_discrepancy/static/description/index.html index cb4c8344d..488e59112 100644 --- a/stock_inventory_discrepancy/static/description/index.html +++ b/stock_inventory_discrepancy/static/description/index.html @@ -1,20 +1,20 @@ - + - + Stock Inventory Discrepancy