diff --git a/mrp_subcontracting_skip_no_negative/README.rst b/mrp_subcontracting_skip_no_negative/README.rst index a6bd4982e..9ddbe6b0f 100644 --- a/mrp_subcontracting_skip_no_negative/README.rst +++ b/mrp_subcontracting_skip_no_negative/README.rst @@ -2,10 +2,13 @@ MRP Subcontracting Skip No Negative =================================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e15e615a77ae456ed0e85a3b2adef82fdc0c372a5ebb670787075700698b09a1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ MRP Subcontracting Skip No Negative .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_subcontracting_skip_no_negative :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/129/16.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/manufacture&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module skips the negative quantity check, provided by stock_no_negative, for subcontracting receipts. @@ -53,7 +56,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/mrp_subcontracting_skip_no_negative/i18n/mrp_subcontracting_skip_no_negative.pot b/mrp_subcontracting_skip_no_negative/i18n/mrp_subcontracting_skip_no_negative.pot new file mode 100644 index 000000000..ce747ae41 --- /dev/null +++ b/mrp_subcontracting_skip_no_negative/i18n/mrp_subcontracting_skip_no_negative.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_subcontracting_skip_no_negative +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \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: mrp_subcontracting_skip_no_negative +#: model:ir.model,name:mrp_subcontracting_skip_no_negative.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: mrp_subcontracting_skip_no_negative +#: model:ir.model,name:mrp_subcontracting_skip_no_negative.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/mrp_subcontracting_skip_no_negative/models/__init__.py b/mrp_subcontracting_skip_no_negative/models/__init__.py index 6bda2d242..a33bde1e8 100644 --- a/mrp_subcontracting_skip_no_negative/models/__init__.py +++ b/mrp_subcontracting_skip_no_negative/models/__init__.py @@ -1 +1,2 @@ from . import stock_move +from . import stock_picking diff --git a/mrp_subcontracting_skip_no_negative/models/stock_picking.py b/mrp_subcontracting_skip_no_negative/models/stock_picking.py new file mode 100644 index 000000000..015c8554a --- /dev/null +++ b/mrp_subcontracting_skip_no_negative/models/stock_picking.py @@ -0,0 +1,22 @@ +# Copyright 2023 Quartile Limited +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import models + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + def _action_done(self): + res = super()._action_done() + self._check_negative_quants_after_process() + return res + + def _check_negative_quants_after_process(self): + product_ids = self.mapped("move_ids.product_id.id") + quants = self.env["stock.quant"].search( + [ + ("product_id", "in", product_ids), + ] + ) + quants.check_negative_qty() diff --git a/mrp_subcontracting_skip_no_negative/static/description/index.html b/mrp_subcontracting_skip_no_negative/static/description/index.html index 384babb2d..b88a79f5b 100644 --- a/mrp_subcontracting_skip_no_negative/static/description/index.html +++ b/mrp_subcontracting_skip_no_negative/static/description/index.html @@ -1,20 +1,20 @@ - + - + MRP Subcontracting Skip No Negative