From 3ba2001d46fd62c5dfd4413f396b6a44a17a8ac1 Mon Sep 17 00:00:00 2001 From: Christian Santamaria Date: Mon, 27 May 2024 12:16:54 +0200 Subject: [PATCH] [ADD] stock_picking_out_lock_immediate_validation --- .../README.rst | 60 +++ .../__init__.py | 1 + .../__manifest__.py | 16 + .../i18n/es.po | 42 ++ ..._picking_out_lock_immediate_validation.pot | 42 ++ .../models/__init__.py | 1 + .../models/stock_picking.py | 19 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 1 + .../static/description/icon.png | Bin 0 -> 1249 bytes .../static/description/index.html | 416 ++++++++++++++++++ 11 files changed, 599 insertions(+) create mode 100644 stock_picking_out_lock_immediate_validation/README.rst create mode 100644 stock_picking_out_lock_immediate_validation/__init__.py create mode 100644 stock_picking_out_lock_immediate_validation/__manifest__.py create mode 100644 stock_picking_out_lock_immediate_validation/i18n/es.po create mode 100644 stock_picking_out_lock_immediate_validation/i18n/stock_picking_out_lock_immediate_validation.pot create mode 100644 stock_picking_out_lock_immediate_validation/models/__init__.py create mode 100644 stock_picking_out_lock_immediate_validation/models/stock_picking.py create mode 100644 stock_picking_out_lock_immediate_validation/readme/CONTRIBUTORS.rst create mode 100644 stock_picking_out_lock_immediate_validation/readme/DESCRIPTION.rst create mode 100644 stock_picking_out_lock_immediate_validation/static/description/icon.png create mode 100644 stock_picking_out_lock_immediate_validation/static/description/index.html diff --git a/stock_picking_out_lock_immediate_validation/README.rst b/stock_picking_out_lock_immediate_validation/README.rst new file mode 100644 index 00000000..55148283 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/README.rst @@ -0,0 +1,60 @@ +=========================================== +Stock Picking Out Lock Immediate Validation +=========================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:73fed8cb503acb01814c1545643b9885e1d1e6c001b2c29d5a0e1d6df691eb6f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-solvosci%2Fslv--stock-lightgray.png?logo=github + :target: https://github.com/solvosci/slv-stock/tree/14.0/stock_picking_out_lock_immediate_validation + :alt: solvosci/slv-stock + +|badge1| |badge2| |badge3| + +Adds lock on the validate button for outputs picking if there is no quantity made. + +**Table of contents** + +.. contents:: + :local: + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Solvos + +Contributors +~~~~~~~~~~~~ + +* Christian Santamaría + +Maintainers +~~~~~~~~~~~ + +This module is part of the `solvosci/slv-stock `_ project on GitHub. + +You are welcome to contribute. 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..60cfc3df --- /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 picking if there is no quantity made. + """, + "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..07a823b2 --- /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 "Picking cannot be validated if there is no quantity done." +msgstr "El albarán 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..a5b6e7b5 --- /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 "Picking 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..8e734b08 --- /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.filtered(lambda x: x.picking_type_code == 'outgoing'): + raise ValidationError( + _("Picking 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..49f9a812 --- /dev/null +++ b/stock_picking_out_lock_immediate_validation/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds lock on the validate button for outputs picking if there is no quantity made. 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 0000000000000000000000000000000000000000..3d7dab5d3a6cebcefa33b32a1c615ca0d5f0f4f2 GIT binary patch literal 1249 zcmV<71Rnc|P)00009a7bBm000ie z000ie0hKEb8vpUD))Of#=qW`2RM`*Iafc2uHa+9zZ)F6Qwl=$sL|4Kfvg1hg<)c0~>nI|+ zidT(j$O3{WUL3elM06z%iu$p=698^6J&7l`ODRPFyj}GgM>CouQRb?|^vVi2ds!BN zsJjT#9`a&i37Cx~U^bS3*;oQ*V+ojzC15tP03wJhwSfwoz34)ftmC8FfOK8Q9WFDn zDN#WoRO>2p(zKqzgmOog6okI{neS&J@#L2N=T)+fP>rv{Tg@Oc^Pvc^u(|PIZDlo; zG!*^VL6^@}W>b_Z3?c4$?UprWBk^qw4OR5bRI-0+G9{!hym89O+GUNcjRy&B4GN)S z2RWaMlcMv2&^;L*eH8norQPp-#h5^rMxNQIWbL6Ezbbm))cEu5Z2+({%(?m#7Xk{6 z{Ij9zx)lA3!TxCc830g-3)5zKNOmroh8gkd2oQ=#8JzFxbhK7Jr zV_@OYxg)QuqyIVnyx{gXr^fX9s@uk@yMDVrx~z__si8|ih0f>&G&1Onu7pA;6gZR7 zFeXr7!RSG$!DFF&!dP@AlE!Ck=Zy*cG&y$t_g{;6o|1P?HC=9c^S9Y(+gD$fSgQ4? z&)`3C$>$~e&dc&D@!!P~FdIw2Y%Bq@u>{P<5-=NM0toGcFi9W)p!TB_g^;n=X#wLq z(T6?b;is!BMLf^#bakF=YW3IABq;(6#Ufp|ZVt!(Dxws}+OM1qUTtYFW=AG#+zUTV z=+$sLU7aV-wEF95GV8oV()fI!cW5S}vs5N}x#Ixn+>!AZ-(6muSblc8+|yX@k!D}O z_)c`XXZ(-Cv!U!d0Dvgs+0pdm52&hvJnF||g{=o$h% z#&_e3Lre2(d}{CA+!{NJN?I^Me|>iJYdHS*-ckhPAdm0W=#_pOF4q3>+2GZd_QQLk z=M~uLdhX~-IK~!KYfSU$bgQE4!t98UCwf*6+Ces4Bm?rI0)W9-WOOd}Ve?!0qUR7u zV;t5Oy?};{C9K2~R`e`r2bHa%$*#c2KMO{qE8!Sho5$Pit^xo&7v{rX8;h=l zwo}J1QK#PrTKlwI?im)vpC8AHP7eTyRPyHhjC7qI`={P<5-=M}z-%l5vw4XGNP;M_7KwH$kW`7K00;u + + + + + +Stock Picking Out Lock Immediate Validation + + + +
+

Stock Picking Out Lock Immediate Validation

+ + +

Beta License: LGPL-3 solvosci/slv-stock

+

Adds lock on the validate button for outputs picking if there is no quantity made.

+

Table of contents

+ +
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Solvos
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the solvosci/slv-stock project on GitHub.

+

You are welcome to contribute.

+
+
+
+ +