-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] mrp_coponent_show_info: Lot List and quantities in Production C…
…omponents list.
- Loading branch information
1 parent
14cdfca
commit 464bf6c
Showing
10 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import stock_move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |