diff --git a/stock_picking_out_lock_immediate_validation/__init__.py b/stock_picking_out_lock_immediate_validation/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_picking_out_lock_immediate_validation/__manifest__.py b/stock_picking_out_lock_immediate_validation/__manifest__.py new file mode 100644 index 00000000..ab608041 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/__manifest__.py @@ -0,0 +1,16 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html +{ + "name": "Stock Picking Out Lock Immediate Validation", + "summary": """ + Adds lock on the validate button for outputs + """, + "author": "Solvos", + "license": "LGPL-3", + "version": "14.0.1.0.0", + "category": "Inventory", + "website": "https://github.com/solvosci/slv-stock", + "depends": ["stock"], + "data": [], + 'installable': True, +} diff --git a/stock_picking_out_lock_immediate_validation/i18n/es.po b/stock_picking_out_lock_immediate_validation/i18n/es.po new file mode 100644 index 00000000..e2a54369 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/i18n/es.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_out_lock_immediate_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-27 09:34+0000\n" +"PO-Revision-Date: 2024-05-27 09:34+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_out_lock_immediate_validation +#: code:addons/stock_picking_out_lock_immediate_validation/models/stock_picking.py:0 +#, python-format +msgid "Cannot be validated if there is no quantity done." +msgstr "No puede validarse si no hay cantidades hechas." + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model.fields,field_description:stock_picking_out_lock_immediate_validation.field_stock_picking__display_name +msgid "Display Name" +msgstr "Nombre a mostrar" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model.fields,field_description:stock_picking_out_lock_immediate_validation.field_stock_picking__id +msgid "ID" +msgstr "" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model.fields,field_description:stock_picking_out_lock_immediate_validation.field_stock_picking____last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model,name:stock_picking_out_lock_immediate_validation.model_stock_picking +msgid "Transfer" +msgstr "Transferencia" diff --git a/stock_picking_out_lock_immediate_validation/i18n/stock_picking_out_lock_immediate_validation.pot b/stock_picking_out_lock_immediate_validation/i18n/stock_picking_out_lock_immediate_validation.pot new file mode 100644 index 00000000..ce0048f3 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/i18n/stock_picking_out_lock_immediate_validation.pot @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_out_lock_immediate_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-27 09:33+0000\n" +"PO-Revision-Date: 2024-05-27 09:33+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_out_lock_immediate_validation +#: code:addons/stock_picking_out_lock_immediate_validation/models/stock_picking.py:0 +#, python-format +msgid "Cannot be validated if there is no quantity done." +msgstr "" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model.fields,field_description:stock_picking_out_lock_immediate_validation.field_stock_picking__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model.fields,field_description:stock_picking_out_lock_immediate_validation.field_stock_picking__id +msgid "ID" +msgstr "" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model.fields,field_description:stock_picking_out_lock_immediate_validation.field_stock_picking____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_out_lock_immediate_validation +#: model:ir.model,name:stock_picking_out_lock_immediate_validation.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_out_lock_immediate_validation/models/__init__.py b/stock_picking_out_lock_immediate_validation/models/__init__.py new file mode 100644 index 00000000..ae4c2722 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/models/__init__.py @@ -0,0 +1 @@ +from . import stock_picking diff --git a/stock_picking_out_lock_immediate_validation/models/stock_picking.py b/stock_picking_out_lock_immediate_validation/models/stock_picking.py new file mode 100644 index 00000000..dc3ccaf1 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/models/stock_picking.py @@ -0,0 +1,19 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3.0 (http://www.gnu.org/licenses/lgpl-3.0.html) + +from odoo import models, _ +from odoo.exceptions import ValidationError + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + def _action_generate_immediate_wizard(self, show_transfers=False): + if self.picking_type_code == 'outgoing': + raise ValidationError( + _("Cannot be validated if there is no quantity done.") + ) + + return super()._action_generate_immediate_wizard( + show_transfers=show_transfers + ) diff --git a/stock_picking_out_lock_immediate_validation/readme/CONTRIBUTORS.rst b/stock_picking_out_lock_immediate_validation/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..dda4c33e --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Christian Santamaría diff --git a/stock_picking_out_lock_immediate_validation/readme/DESCRIPTION.rst b/stock_picking_out_lock_immediate_validation/readme/DESCRIPTION.rst new file mode 100644 index 00000000..3d0a2507 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds lock on the validate button for outputs diff --git a/stock_picking_out_lock_immediate_validation/static/description/icon.png b/stock_picking_out_lock_immediate_validation/static/description/icon.png new file mode 100644 index 00000000..3d7dab5d Binary files /dev/null and b/stock_picking_out_lock_immediate_validation/static/description/icon.png differ