Skip to content

Commit

Permalink
[ADD] mrp_coponent_show_info: Lot List and quantities in Production C…
Browse files Browse the repository at this point in the history
…omponents list.
  • Loading branch information
alfredoavanzosc committed Jul 5, 2024
1 parent 14cdfca commit 464bf6c
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 0 deletions.
31 changes: 31 additions & 0 deletions mrp_component_show_info/README.rst
Original file line number Diff line number Diff line change
@@ -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
<https://github.com/avanzosc/mrp-addons/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 <[email protected]>
* Ignacio Ales López <[email protected]>
* Ana Juaristi <[email protected]>
* Alfredo de la Fuente <[email protected]>
1 change: 1 addition & 0 deletions mrp_component_show_info/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions mrp_component_show_info/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (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",
"description": """Lista de Lote y cantidades en lista de Componentes de Producción""",
"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,
}
26 changes: 26 additions & 0 deletions mrp_component_show_info/i18n/en_US.po
Original file line number Diff line number Diff line change
@@ -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 ""
26 changes: 26 additions & 0 deletions mrp_component_show_info/i18n/es.po
Original file line number Diff line number Diff line change
@@ -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"
26 changes: 26 additions & 0 deletions mrp_component_show_info/i18n/mrp_component_show_info.pot
Original file line number Diff line number Diff line change
@@ -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 ""
1 change: 1 addition & 0 deletions mrp_component_show_info/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move
30 changes: 30 additions & 0 deletions mrp_component_show_info/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# (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(
string="Production Lot Info", 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:
production_info.append(
f"{move_line.lot_id.name or 'N/A'} ({move_line.reserved_uom_qty or move_line.qty_done})"
)
move.production_lot_info = ", ".join(production_info)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions mrp_component_show_info/views/mrp_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="mrp_production_form_view_inherit" model="ir.ui.view">
<field name="name">mrp.production.lot_info.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
<field name="arch" type="xml">
<xpath
expr="//button[@name='action_show_details' and hasclass('o_optional_button')]"
position="after"
>
<field name="production_lot_info" optional="show" />
</xpath>
</field>
</record>
</odoo>

0 comments on commit 464bf6c

Please sign in to comment.