From 5205d68c08360b437e1d069c16793bd2bb0c5f7b Mon Sep 17 00:00:00 2001 From: Alfredo Date: Tue, 10 Dec 2024 13:11:01 +0100 Subject: [PATCH] [14.0][FIX] mrp_production_cost: Fix "Workorder Real Cost" calculation. --- mrp_production_cost/i18n/es.po | 18 +++++++++--------- mrp_production_cost/models/mrp_workorder.py | 2 +- .../views/mrp_production_views.xml | 9 +++++++++ .../views/mrp_stockmove_views.xml | 2 ++ .../views/mrp_workorder_views.xml | 3 +++ 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/mrp_production_cost/i18n/es.po b/mrp_production_cost/i18n/es.po index fc8c6a805..f67a33fa7 100644 --- a/mrp_production_cost/i18n/es.po +++ b/mrp_production_cost/i18n/es.po @@ -32,26 +32,26 @@ msgstr "Coste de Fabricación real" #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_form_view #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view msgid "Cost Material consumed" -msgstr "Coste de Material consumido" +msgstr "Cte consumido" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_material_to_consume #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_form_view #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view msgid "Cost Material to consume" -msgstr "Coste de Material a consumir" +msgstr "Cte a consumir" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_workorder_estimated #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view msgid "Cost Workorder estimated" -msgstr "Coste de Orden de trabajo estimado" +msgstr "Coste OT estimada" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_workorder_real #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view msgid "Cost Workorder real" -msgstr "Coste de Orden de trabajo real" +msgstr "Coste OT Real" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__display_name @@ -92,13 +92,13 @@ msgstr "Coste hora máquina" #: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__material_cost_consumed #: model_terms:ir.ui.view,arch_db:mrp_production_cost.view_move_tree msgid "Material cost consumed" -msgstr "Coste de Material consumido" +msgstr "Cte consumido" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__material_cost_to_consume #: model_terms:ir.ui.view,arch_db:mrp_production_cost.view_move_tree msgid "Material cost to consume" -msgstr "Coste de Material a consumir" +msgstr "Cte a consumir" #. module: mrp_production_cost #: model:ir.model,name:mrp_production_cost.model_mrp_production @@ -113,7 +113,7 @@ msgstr "Especificar coste por hora del centro de trabajo" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__product_standard_cost msgid "Standard Cost" -msgstr "Coste Estándard" +msgstr "Cte.Estandar" #. module: mrp_production_cost #: model:ir.model,name:mrp_production_cost.model_stock_move @@ -129,10 +129,10 @@ msgstr "Orden de trabajo" #: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__workorder_cost_estimated #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_workorder_tree_editable_view msgid "Workorder Cost estimated" -msgstr "Coste de Orden de trabajo estimado" +msgstr "Coste OT estimada" #. module: mrp_production_cost #: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__workorder_cost_real #: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_workorder_tree_editable_view msgid "Workorder Cost real" -msgstr "Coste de Orden de trabajo real" +msgstr "Coste OT Real" diff --git a/mrp_production_cost/models/mrp_workorder.py b/mrp_production_cost/models/mrp_workorder.py index 34f872119..d31659c67 100644 --- a/mrp_production_cost/models/mrp_workorder.py +++ b/mrp_production_cost/models/mrp_workorder.py @@ -36,4 +36,4 @@ def _compute_workorder_cost_estimated(self): @api.depends("duration", "machine_hour_cost") def _compute_workorder_cost_real(self): for order in self: - order.workorder_cost_real = order.machine_hour_cost * order.duration + order.workorder_cost_real = (order.machine_hour_cost / 60) * order.duration diff --git a/mrp_production_cost/views/mrp_production_views.xml b/mrp_production_cost/views/mrp_production_views.xml index 9ebfaa554..05912c4cd 100644 --- a/mrp_production_cost/views/mrp_production_views.xml +++ b/mrp_production_cost/views/mrp_production_views.xml @@ -11,14 +11,17 @@ @@ -39,31 +42,37 @@ name="cost_material_to_consume" sum="Cost Material to consume" groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost" + optional="show" /> diff --git a/mrp_production_cost/views/mrp_stockmove_views.xml b/mrp_production_cost/views/mrp_stockmove_views.xml index 732354022..5485fc076 100644 --- a/mrp_production_cost/views/mrp_stockmove_views.xml +++ b/mrp_production_cost/views/mrp_stockmove_views.xml @@ -8,10 +8,12 @@ diff --git a/mrp_production_cost/views/mrp_workorder_views.xml b/mrp_production_cost/views/mrp_workorder_views.xml index 583d56a41..b4a9510d1 100644 --- a/mrp_production_cost/views/mrp_workorder_views.xml +++ b/mrp_production_cost/views/mrp_workorder_views.xml @@ -11,14 +11,17 @@