From c91d14c6fe46c31c2adf45681cd69177da60b41c Mon Sep 17 00:00:00 2001 From: Alfredo Date: Fri, 5 Jul 2024 08:18:11 +0200 Subject: [PATCH] [ADD] mrp_component_show_info: Lot List and quantities in Production Components list. --- mrp_component_show_info/README.rst | 31 ++++++++++++++++++ mrp_component_show_info/__init__.py | 1 + mrp_component_show_info/__manifest__.py | 18 ++++++++++ mrp_component_show_info/i18n/en_US.po | 26 +++++++++++++++ mrp_component_show_info/i18n/es.po | 26 +++++++++++++++ .../i18n/mrp_component_show_info.pot | 26 +++++++++++++++ mrp_component_show_info/models/__init__.py | 1 + mrp_component_show_info/models/stock_move.py | 28 ++++++++++++++++ .../static/description/icon.png | Bin 0 -> 1714 bytes mrp_component_show_info/views/mrp_view.xml | 16 +++++++++ 10 files changed, 173 insertions(+) create mode 100644 mrp_component_show_info/README.rst create mode 100644 mrp_component_show_info/__init__.py create mode 100644 mrp_component_show_info/__manifest__.py create mode 100644 mrp_component_show_info/i18n/en_US.po create mode 100644 mrp_component_show_info/i18n/es.po create mode 100644 mrp_component_show_info/i18n/mrp_component_show_info.pot create mode 100644 mrp_component_show_info/models/__init__.py create mode 100644 mrp_component_show_info/models/stock_move.py create mode 100755 mrp_component_show_info/static/description/icon.png create mode 100644 mrp_component_show_info/views/mrp_view.xml diff --git a/mrp_component_show_info/README.rst b/mrp_component_show_info/README.rst new file mode 100644 index 000000000..f6c8f92e7 --- /dev/null +++ b/mrp_component_show_info/README.rst @@ -0,0 +1,31 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================= +MRP Component Show Info +======================= + +* Lot List and quantities in Production Components list. + + +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 smash it by providing detailed and welcomed feedback. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Contributors +------------ + +* Ana Iris Castro Ramírez +* Ignacio Ales López +* Ana Juaristi +* Alfredo de la Fuente diff --git a/mrp_component_show_info/__init__.py b/mrp_component_show_info/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/mrp_component_show_info/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mrp_component_show_info/__manifest__.py b/mrp_component_show_info/__manifest__.py new file mode 100644 index 000000000..b946ba854 --- /dev/null +++ b/mrp_component_show_info/__manifest__.py @@ -0,0 +1,18 @@ +# (c) Ana Iris Castro Ramírez - Guadaltech +# (c) Ignacio Ales López - Guadaltech +# (c) 2024 Alfredo de la Fuente - Avanzosc +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +{ + "name": "MRP Component Show Info", + "version": "16.0.1.0.0", + "category": "Manufacturing", + "author": "Guadaltech Soluciones Tecnológicas S.L., AvanzOSC", + "website": "https://github.com/avanzosc/mrp-addons", + "license": "LGPL-3", + "depends": ["mrp"], + "data": [ + "views/mrp_view.xml", + ], + "installable": True, + "active": False, +} diff --git a/mrp_component_show_info/i18n/en_US.po b/mrp_component_show_info/i18n/en_US.po new file mode 100644 index 000000000..0531ff40a --- /dev/null +++ b/mrp_component_show_info/i18n/en_US.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_component_show_info +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-05 04:59+0000\n" +"PO-Revision-Date: 2024-07-05 04:59+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: mrp_component_show_info +#: model:ir.model.fields,field_description:mrp_component_show_info.field_stock_move__production_lot_info +msgid "Production Lot Info" +msgstr "" + +#. module: mrp_component_show_info +#: model:ir.model,name:mrp_component_show_info.model_stock_move +msgid "Stock Move" +msgstr "" diff --git a/mrp_component_show_info/i18n/es.po b/mrp_component_show_info/i18n/es.po new file mode 100644 index 000000000..acd58dbd9 --- /dev/null +++ b/mrp_component_show_info/i18n/es.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_component_show_info +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-05 05:00+0000\n" +"PO-Revision-Date: 2024-07-05 05:00+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: mrp_component_show_info +#: model:ir.model.fields,field_description:mrp_component_show_info.field_stock_move__production_lot_info +msgid "Production Lot Info" +msgstr "Inf. Lote producción" + +#. module: mrp_component_show_info +#: model:ir.model,name:mrp_component_show_info.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de existencias" diff --git a/mrp_component_show_info/i18n/mrp_component_show_info.pot b/mrp_component_show_info/i18n/mrp_component_show_info.pot new file mode 100644 index 000000000..0531ff40a --- /dev/null +++ b/mrp_component_show_info/i18n/mrp_component_show_info.pot @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_component_show_info +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-05 04:59+0000\n" +"PO-Revision-Date: 2024-07-05 04:59+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: mrp_component_show_info +#: model:ir.model.fields,field_description:mrp_component_show_info.field_stock_move__production_lot_info +msgid "Production Lot Info" +msgstr "" + +#. module: mrp_component_show_info +#: model:ir.model,name:mrp_component_show_info.model_stock_move +msgid "Stock Move" +msgstr "" diff --git a/mrp_component_show_info/models/__init__.py b/mrp_component_show_info/models/__init__.py new file mode 100644 index 000000000..6bda2d242 --- /dev/null +++ b/mrp_component_show_info/models/__init__.py @@ -0,0 +1 @@ +from . import stock_move diff --git a/mrp_component_show_info/models/stock_move.py b/mrp_component_show_info/models/stock_move.py new file mode 100644 index 000000000..94997e117 --- /dev/null +++ b/mrp_component_show_info/models/stock_move.py @@ -0,0 +1,28 @@ +# (c) Ana Iris Castro Ramírez - Guadaltech +# (c) Ignacio Ales López - Guadaltech +# (c) 2024 Alfredo de la Fuente - Avanzosc +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +from odoo import api, fields, models + + +class StockMove(models.Model): + _inherit = "stock.move" + + production_lot_info = fields.Text(compute="_compute_production_lot_info") + + @api.depends( + "move_line_ids", + "move_line_ids.lot_id", + "move_line_ids.lot_id.name", + "move_line_ids.qty_done", + ) + def _compute_production_lot_info(self): + for move in self: + move.production_lot_info = "" + if move.raw_material_production_id and move.product_id.tracking != "none": + production_info = [] + for move_line in move.move_line_ids: + name = move_line.lot_id.name or "N/A" + qty = move_line.reserved_uom_qty or move_line.qty_done + production_info.append(f"{name} ({qty})") + move.production_lot_info = ", ".join(production_info) diff --git a/mrp_component_show_info/static/description/icon.png b/mrp_component_show_info/static/description/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..3a50007fd3799536f07f55b43851b1570c708f93 GIT binary patch literal 1714 zcmaJ>`#%$k0~J@kw0$d)dG@*_ufl&^$sYWe9oQ5|?4QFfZU@i~{oElS;pHD6~!?Mz6Vj{;7wFxL3db!DDYj=lUuZ65n|JX#$t?W2F^wbh!6=eJR zlr9XC*tixtZ=tbwX^OtZ&gif2?qah0BBQ(CW(_ocqjfiaDZ>j1iFP2&Za6$G-7H=U ze`_gq(_B>c7fD9$FBubseOD@{yqjVKf8h;;z~_Axs(G>dHW9G4^^Gv3qa93B?C1J_ zhQ$aOcRgmnDCG>#HZ+jzL>{RZF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