From b02d22df426d62d6eb3d82e4c4785cfa101e5e68 Mon Sep 17 00:00:00 2001 From: Oihane Crucelaegui Date: Wed, 15 May 2024 13:04:07 +0200 Subject: [PATCH] [FIX] mrp_workorder_grouping_by_material: move line does not have qty_to_consume --- .../__manifest__.py | 2 +- mrp_workorder_grouping_by_material/i18n/es.po | 24 ++++++++++++----- .../mrp_workorder_grouping_by_material.pot | 26 ++++++++++++++----- .../models/mrp_workorder_nest_line.py | 10 +++---- .../views/mrp_workorder_nest_view.xml | 15 ++++++++++- 5 files changed, 57 insertions(+), 20 deletions(-) diff --git a/mrp_workorder_grouping_by_material/__manifest__.py b/mrp_workorder_grouping_by_material/__manifest__.py index 9a261ed26..816a07ffe 100644 --- a/mrp_workorder_grouping_by_material/__manifest__.py +++ b/mrp_workorder_grouping_by_material/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Workorders grouping by main material", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "depends": [ "mrp", diff --git a/mrp_workorder_grouping_by_material/i18n/es.po b/mrp_workorder_grouping_by_material/i18n/es.po index d200bac27..839cb3839 100644 --- a/mrp_workorder_grouping_by_material/i18n/es.po +++ b/mrp_workorder_grouping_by_material/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-11 08:49+0000\n" -"PO-Revision-Date: 2023-09-11 08:49+0000\n" +"POT-Creation-Date: 2024-05-15 11:44+0000\n" +"PO-Revision-Date: 2024-05-15 11:44+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -26,6 +26,14 @@ msgid "" " * Cancelled: The MO has been cancelled, can't be confirmed anymore." msgstr "Técnico: utilizado sólo en vistas" +#. module: mrp_workorder_grouping_by_material +#. odoo-python +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#, python-format +msgid "%(workorder)s: %(error_name)s" +msgstr "" + #. module: mrp_workorder_grouping_by_material #: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_production_view_form #: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_workorder_view_form @@ -381,6 +389,7 @@ msgstr "Material principal" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 #, python-format msgid "Main material must have an operation" msgstr "El material principal debe tener una operación" @@ -388,6 +397,7 @@ msgstr "El material principal debe tener una operación" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 #, python-format msgid "Main product lot is not selected" msgstr "No seleccionado lote para material principal" @@ -739,10 +749,6 @@ msgstr "Empezar a trabajar" #. module: mrp_workorder_grouping_by_material #: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest__state -msgid "State" -msgstr "Estado" - -#. module: mrp_workorder_grouping_by_material #: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__state msgid "Status" msgstr "Estado" @@ -774,6 +780,7 @@ msgstr "El número de productos tomados por esta orden de trabajo" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0 #, python-format msgid "The workcenter is 'nesting_required'" msgstr "El centro de trabajo requiere anidado" @@ -781,6 +788,7 @@ msgstr "El centro de trabajo requiere anidado" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 #, python-format msgid "" "There can only be one main material per operation. Check lines that contains" @@ -874,6 +882,7 @@ msgstr "Estado de la orden de trabajo" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 #: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__worksheet #, python-format msgid "Worksheet" @@ -882,6 +891,7 @@ msgstr "Hoja de trabajo" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 #, python-format msgid "Worksheets" msgstr "Hojas de trabajo" @@ -889,6 +899,7 @@ msgstr "Hojas de trabajo" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0 #, python-format msgid "" "the quantity to be produced must be less than or equal to quantity produced" @@ -897,6 +908,7 @@ msgstr "La cantidad a producir debe ser menor o igual a la cantidad producida" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 #, python-format msgid "{}: You should provide a lot/serial number for the final product." msgstr "{}: Deberias de añadir un lot/num. de serie para el producto final." diff --git a/mrp_workorder_grouping_by_material/i18n/mrp_workorder_grouping_by_material.pot b/mrp_workorder_grouping_by_material/i18n/mrp_workorder_grouping_by_material.pot index 88e58ad61..e266937b6 100644 --- a/mrp_workorder_grouping_by_material/i18n/mrp_workorder_grouping_by_material.pot +++ b/mrp_workorder_grouping_by_material/i18n/mrp_workorder_grouping_by_material.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-11 08:49+0000\n" -"PO-Revision-Date: 2023-09-11 08:49+0000\n" +"POT-Creation-Date: 2024-05-15 11:44+0000\n" +"PO-Revision-Date: 2024-05-15 11:44+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -26,6 +26,14 @@ msgid "" " * Cancelled: The MO has been cancelled, can't be confirmed anymore." msgstr "" +#. module: mrp_workorder_grouping_by_material +#. odoo-python +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#, python-format +msgid "%(workorder)s: %(error_name)s" +msgstr "" + #. module: mrp_workorder_grouping_by_material #: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_production_view_form #: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_workorder_view_form @@ -381,6 +389,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 #, python-format msgid "Main material must have an operation" msgstr "" @@ -388,6 +397,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 #, python-format msgid "Main product lot is not selected" msgstr "" @@ -564,7 +574,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #: model:ir.model.fields,help:mrp_workorder_grouping_by_material.field_mrp_workorder_nest__message_needaction_counter -msgid "Number of messages which requires an action" +msgid "Number of messages requiring action" msgstr "" #. module: mrp_workorder_grouping_by_material @@ -739,10 +749,6 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest__state -msgid "State" -msgstr "" - -#. module: mrp_workorder_grouping_by_material #: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__state msgid "Status" msgstr "" @@ -770,6 +776,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0 #, python-format msgid "The workcenter is 'nesting_required'" msgstr "" @@ -777,6 +784,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0 #, python-format msgid "" "There can only be one main material per operation. Check lines that contains" @@ -870,6 +878,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 #: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__worksheet #, python-format msgid "Worksheet" @@ -878,6 +887,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0 #, python-format msgid "Worksheets" msgstr "" @@ -885,6 +895,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0 #, python-format msgid "" "the quantity to be produced must be less than or equal to quantity produced" @@ -893,6 +904,7 @@ msgstr "" #. module: mrp_workorder_grouping_by_material #. odoo-python #: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 +#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0 #, python-format msgid "{}: You should provide a lot/serial number for the final product." msgstr "" diff --git a/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py b/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py index f339da060..7c95d6101 100644 --- a/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py +++ b/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py @@ -293,7 +293,7 @@ def _write_lot_producing_qty(self): move_line.write( { "lot_id": n_line.nest_id.lot_id.id, - "qty_done": move_line.qty_to_consume, + "qty_done": move_line.reserved_qty, } ) # if res: @@ -326,10 +326,10 @@ def action_check_ready(self): elif nl.workorder_id.state == "done": nl.state = "done" - def action_cancel(self): - if not any(self.filtered(lambda n: n.state == "ready")): - raise UserError(_("")) - return self.write({"state": "cancel"}) + # def action_cancel(self): + # if not any(self.filtered(lambda n: n.state == "ready")): + # raise UserError(_("")) + # return self.write({"state": "cancel"}) def button_start(self): for nl in self.filtered(lambda n: n.state == "ready"): diff --git a/mrp_workorder_grouping_by_material/views/mrp_workorder_nest_view.xml b/mrp_workorder_grouping_by_material/views/mrp_workorder_nest_view.xml index dbf681530..4eaeb9846 100644 --- a/mrp_workorder_grouping_by_material/views/mrp_workorder_nest_view.xml +++ b/mrp_workorder_grouping_by_material/views/mrp_workorder_nest_view.xml @@ -23,6 +23,12 @@ string="Planned Start Date" domain="[]" context="{'group_by': 'date_planned_start'}" + /> + @@ -39,7 +45,14 @@ - +