Skip to content

Commit

Permalink
[14.0][FIX] mrp_production_cost: Fix "Workorder Real Cost" calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredoavanzosc committed Dec 10, 2024
1 parent 71de46e commit 5205d68
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
18 changes: 9 additions & 9 deletions mrp_production_cost/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
2 changes: 1 addition & 1 deletion mrp_production_cost/models/mrp_workorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions mrp_production_cost/views/mrp_production_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
<field
name="product_standard_cost"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="material_cost_to_consume"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="material_cost_consumed"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
</xpath>
<field name="material_cost_to_consume" position="attributes">
Expand All @@ -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"
/>
<field
name="cost_material_consumed"
sum="Cost Material consumed"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="cost_workorder_estimated"
sum="Cost Workorder estimated"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="cost_workorder_real"
sum="Cost Workorder real"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="cost_manufacturing_estimated"
sum="Cost Manufacturing estimated"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="cost_manufacturing_real"
sum="Cost Manufacturing real"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
</field>
</field>
Expand Down
2 changes: 2 additions & 0 deletions mrp_production_cost/views/mrp_stockmove_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
<field
name="material_cost_to_consume"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="material_cost_consumed"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
</xpath>
<field name="material_cost_to_consume" position="attributes">
Expand Down
3 changes: 3 additions & 0 deletions mrp_production_cost/views/mrp_workorder_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
<field
name="machine_hour_cost"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="workorder_cost_estimated"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
<field
name="workorder_cost_real"
groups="mrp_bom_report_group.group_mrp_bom_report_group_see_cost"
optional="show"
/>
</xpath>
<field name="workorder_cost_estimated" position="attributes">
Expand Down

0 comments on commit 5205d68

Please sign in to comment.