diff --git a/mrp_production_cost/README.rst b/mrp_production_cost/README.rst
index 39b9a95df..b9176a2fd 100644
--- a/mrp_production_cost/README.rst
+++ b/mrp_production_cost/README.rst
@@ -6,11 +6,9 @@
MRP Production Cost
===================
-Cost related fields in manufacturing orders:
+This module makes an estimation of the cost of a Manufacturing Order.
-* In "Components" of a Manufacturing Order
-* In "Work Orders" of a Manufacturing Order
-* In the Manufacturing Order List
+The user can visualise the cost data in the component lines, in the work orders and in the list of production orders.
Bug Tracker
===========
diff --git a/mrp_production_cost/__manifest__.py b/mrp_production_cost/__manifest__.py
index 3ede196a4..c2b114a87 100644
--- a/mrp_production_cost/__manifest__.py
+++ b/mrp_production_cost/__manifest__.py
@@ -4,9 +4,9 @@
"name": "MRP Production Cost",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-addons",
- "category": "MRP",
+ "category": "Manufacturing/Manufacturing",
"license": "AGPL-3",
- "version": "14.0.1.0.0",
+ "version": "16.0.1.0.0",
"depends": [
"product",
"mrp",
diff --git a/mrp_production_cost/i18n/es.po b/mrp_production_cost/i18n/es.po
index fc8c6a805..fb6c905ff 100644
--- a/mrp_production_cost/i18n/es.po
+++ b/mrp_production_cost/i18n/es.po
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 14.0\n"
+"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-06-20 13:26+0000\n"
-"PO-Revision-Date: 2022-06-20 13:26+0000\n"
+"POT-Creation-Date: 2024-07-16 08:40+0000\n"
+"PO-Revision-Date: 2024-07-16 08:40+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,104 +16,71 @@ msgstr ""
"Plural-Forms: \n"
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_estimated
-#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view
-msgid "Cost Manufacturing estimated"
-msgstr "Coste de Fabricación estimado"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__workorder_cost_estimated
+#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__material_cost_to_consume
+msgid "Estimated Cost"
+msgstr "Coste estimado"
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_real
-#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view
-msgid "Cost Manufacturing real"
-msgstr "Coste de Fabricación real"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_estimated
+msgid "Estimated Manufacturing Cost"
+msgstr "Coste de fabricación estimado"
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_material_consumed
-#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_form_view
+#: 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_tree_view
-msgid "Cost Material consumed"
-msgstr "Coste de Material consumido"
+msgid "Estimated Material Cost"
+msgstr "Coste de material estimado"
#. 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"
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_workorder_tree_editable_view
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.view_move_tree
+msgid "Estimated Total Cost"
+msgstr "Coste total estimado"
#. 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"
-
-#. 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"
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__display_name
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__display_name
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__display_name
-msgid "Display Name"
-msgstr "Nombre mostrado"
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__id
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__id
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__id
-msgid "ID"
-msgstr ""
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,help:mrp_production_cost.field_stock_move__product_standard_cost
-msgid ""
-"In Standard Price & AVCO: value of the product (automatically computed in AVCO).\n"
-" In FIFO: value of the last unit that left the stock (automatically computed).\n"
-" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n"
-" Used to compute margins on sale orders."
-msgstr ""
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production____last_update
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder____last_update
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move____last_update
-msgid "Last Modified on"
-msgstr "Última modificación el"
+msgid "Estimated Work Cost"
+msgstr "Coste de trabajo estimado"
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__machine_hour_cost
-msgid "Machine hour cost"
-msgstr "Coste hora máquina"
+#: model:ir.model,name:mrp_production_cost.model_mrp_production
+msgid "Production Order"
+msgstr "Orden de producción"
#. module: mrp_production_cost
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__workorder_cost_real
#: 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"
+msgid "Real Cost"
+msgstr "Coste real"
#. 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"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_real
+msgid "Real Manufacturing Cost"
+msgstr "Coste de fabricación real"
#. module: mrp_production_cost
-#: model:ir.model,name:mrp_production_cost.model_mrp_production
-msgid "Production Order"
-msgstr "Orden de producción"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_material_consumed
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view
+msgid "Real Material Cost"
+msgstr "Coste de material real"
#. module: mrp_production_cost
-#: model:ir.model.fields,help:mrp_production_cost.field_mrp_workorder__machine_hour_cost
-msgid "Specify cost of work center per hour."
-msgstr "Especificar coste por hora del centro de trabajo"
+#: 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
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_workorder_tree_editable_view
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.view_move_tree
+msgid "Real Total Cost"
+msgstr "Coste real total"
#. 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"
+#: 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 "Real Work Cost"
+msgstr "Coste de trabajo real"
#. module: mrp_production_cost
#: model:ir.model,name:mrp_production_cost.model_stock_move
@@ -124,15 +91,3 @@ msgstr "Movimiento de existencias"
#: model:ir.model,name:mrp_production_cost.model_mrp_workorder
msgid "Work Order"
msgstr "Orden de trabajo"
-
-#. module: mrp_production_cost
-#: 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"
-
-#. 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"
diff --git a/mrp_production_cost/i18n/mrp_production_cost.pot b/mrp_production_cost/i18n/mrp_production_cost.pot
index 452895071..e81077937 100644
--- a/mrp_production_cost/i18n/mrp_production_cost.pot
+++ b/mrp_production_cost/i18n/mrp_production_cost.pot
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 14.0\n"
+"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-06-20 13:26+0000\n"
-"PO-Revision-Date: 2022-06-20 13:26+0000\n"
+"POT-Creation-Date: 2024-07-16 08:40+0000\n"
+"PO-Revision-Date: 2024-07-16 08:40+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,103 +16,70 @@ msgstr ""
"Plural-Forms: \n"
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_estimated
-#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view
-msgid "Cost Manufacturing estimated"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__workorder_cost_estimated
+#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__material_cost_to_consume
+msgid "Estimated Cost"
msgstr ""
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_real
-#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view
-msgid "Cost Manufacturing real"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_estimated
+msgid "Estimated Manufacturing Cost"
msgstr ""
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_material_consumed
-#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_form_view
+#: 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_tree_view
-msgid "Cost Material consumed"
+msgid "Estimated Material Cost"
msgstr ""
#. 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"
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_workorder_tree_editable_view
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.view_move_tree
+msgid "Estimated Total Cost"
msgstr ""
#. 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 ""
-
-#. 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 ""
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__display_name
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__display_name
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__display_name
-msgid "Display Name"
-msgstr ""
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__id
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__id
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__id
-msgid "ID"
-msgstr ""
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,help:mrp_production_cost.field_stock_move__product_standard_cost
-msgid ""
-"In Standard Price & AVCO: value of the product (automatically computed in AVCO).\n"
-" In FIFO: value of the last unit that left the stock (automatically computed).\n"
-" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n"
-" Used to compute margins on sale orders."
-msgstr ""
-
-#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production____last_update
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder____last_update
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move____last_update
-msgid "Last Modified on"
+msgid "Estimated Work Cost"
msgstr ""
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__machine_hour_cost
-msgid "Machine hour cost"
+#: model:ir.model,name:mrp_production_cost.model_mrp_production
+msgid "Production Order"
msgstr ""
#. module: mrp_production_cost
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_workorder__workorder_cost_real
#: 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"
+msgid "Real Cost"
msgstr ""
#. 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"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_manufacturing_real
+msgid "Real Manufacturing Cost"
msgstr ""
#. module: mrp_production_cost
-#: model:ir.model,name:mrp_production_cost.model_mrp_production
-msgid "Production Order"
+#: model:ir.model.fields,field_description:mrp_production_cost.field_mrp_production__cost_material_consumed
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_tree_view
+msgid "Real Material Cost"
msgstr ""
#. module: mrp_production_cost
-#: model:ir.model.fields,help:mrp_production_cost.field_mrp_workorder__machine_hour_cost
-msgid "Specify cost of work center per hour."
+#: 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
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.mrp_production_workorder_tree_editable_view
+#: model_terms:ir.ui.view,arch_db:mrp_production_cost.view_move_tree
+msgid "Real Total Cost"
msgstr ""
#. module: mrp_production_cost
-#: model:ir.model.fields,field_description:mrp_production_cost.field_stock_move__product_standard_cost
-msgid "Standard 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 "Real Work Cost"
msgstr ""
#. module: mrp_production_cost
@@ -124,15 +91,3 @@ msgstr ""
#: model:ir.model,name:mrp_production_cost.model_mrp_workorder
msgid "Work Order"
msgstr ""
-
-#. module: mrp_production_cost
-#: 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 ""
-
-#. 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 ""
diff --git a/mrp_production_cost/models/mrp_production.py b/mrp_production_cost/models/mrp_production.py
index 6a88a8c7d..cf316c86e 100644
--- a/mrp_production_cost/models/mrp_production.py
+++ b/mrp_production_cost/models/mrp_production.py
@@ -8,39 +8,39 @@ class MrpProduction(models.Model):
# Material costs
cost_material_to_consume = fields.Float(
- string="Cost Material to consume",
+ string="Estimated Material Cost",
copy=False,
store=True,
compute="_compute_cost_material_to_consume",
)
cost_material_consumed = fields.Float(
- string="Cost Material consumed",
+ string="Real Material Cost",
copy=False,
store=True,
compute="_compute_cost_material_consumed",
)
# Workorder costs
cost_workorder_estimated = fields.Float(
- string="Cost Workorder estimated",
+ string="Estimated Work Cost",
copy=False,
store=True,
compute="_compute_cost_workorder_estimated",
)
cost_workorder_real = fields.Float(
- string="Cost Workorder real",
+ string="Real Work Cost",
copy=False,
store=True,
compute="_compute_cost_workorder_real",
)
# Manufacturing costs
cost_manufacturing_estimated = fields.Float(
- string="Cost Manufacturing estimated",
+ string="Estimated Manufacturing Cost",
copy=False,
store=True,
compute="_compute_cost_manufacturing_estimated",
)
cost_manufacturing_real = fields.Float(
- string="Cost Manufacturing real",
+ string="Real Manufacturing Cost",
copy=False,
store=True,
compute="_compute_cost_manufacturing_real",
@@ -50,28 +50,28 @@ class MrpProduction(models.Model):
def _compute_cost_material_to_consume(self):
for production in self:
production.cost_material_to_consume = sum(
- production.move_raw_ids.mapped("material_cost_to_consume")
+ production.mapped("move_raw_ids.material_cost_to_consume")
)
@api.depends("move_raw_ids.material_cost_consumed")
def _compute_cost_material_consumed(self):
for production in self:
production.cost_material_consumed = sum(
- production.move_raw_ids.mapped("material_cost_consumed")
+ production.mapped("move_raw_ids.material_cost_consumed")
)
@api.depends("workorder_ids.workorder_cost_estimated")
def _compute_cost_workorder_estimated(self):
for production in self:
production.cost_workorder_estimated = sum(
- production.workorder_ids.mapped("workorder_cost_estimated")
+ production.mapped("workorder_ids.workorder_cost_estimated")
)
@api.depends("workorder_ids.workorder_cost_real")
def _compute_cost_workorder_real(self):
for production in self:
production.cost_workorder_real = sum(
- production.workorder_ids.mapped("workorder_cost_real")
+ production.mapped("workorder_ids.workorder_cost_real")
)
@api.depends("cost_material_to_consume", "cost_workorder_estimated")
diff --git a/mrp_production_cost/models/mrp_workorder.py b/mrp_production_cost/models/mrp_workorder.py
index 34f872119..aebd1aa23 100644
--- a/mrp_production_cost/models/mrp_workorder.py
+++ b/mrp_production_cost/models/mrp_workorder.py
@@ -6,34 +6,25 @@
class MrpWorkorder(models.Model):
_inherit = "mrp.workorder"
- machine_hour_cost = fields.Float(
- string="Machine hour cost",
- readonly=True,
- store=True,
- copy=False,
- related="workcenter_id.costs_hour",
- )
workorder_cost_estimated = fields.Float(
- string="Workorder Cost estimated",
+ string="Estimated Cost",
copy=False,
store=True,
compute="_compute_workorder_cost_estimated",
)
workorder_cost_real = fields.Float(
- string="Workorder Cost real",
+ string="Real Cost",
copy=False,
store=True,
compute="_compute_workorder_cost_real",
)
- @api.depends("duration_expected", "machine_hour_cost")
+ @api.depends("duration_expected", "costs_hour")
def _compute_workorder_cost_estimated(self):
for order in self:
- order.workorder_cost_estimated = (
- order.machine_hour_cost * order.duration_expected
- )
+ order.workorder_cost_estimated = order.costs_hour * order.duration_expected
- @api.depends("duration", "machine_hour_cost")
+ @api.depends("duration", "costs_hour")
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.costs_hour * order.duration
diff --git a/mrp_production_cost/models/stock_move.py b/mrp_production_cost/models/stock_move.py
index 7a0215bb9..41b6c8ef2 100644
--- a/mrp_production_cost/models/stock_move.py
+++ b/mrp_production_cost/models/stock_move.py
@@ -6,36 +6,25 @@
class StockMove(models.Model):
_inherit = "stock.move"
- product_standard_cost = fields.Float(
- string="Standard Cost",
- readonly=True,
- store=True,
- copy=False,
- related="product_id.standard_price",
- )
material_cost_to_consume = fields.Float(
- string="Material cost to consume",
+ string="Estimated Cost",
store=True,
copy=False,
compute="_compute_material_cost_to_consume",
)
material_cost_consumed = fields.Float(
- string="Material cost consumed",
+ string="Real Cost",
store=True,
copy=False,
compute="_compute_material_cost_consumed",
)
- @api.depends("product_standard_cost", "product_uom_qty")
+ @api.depends("price_unit", "product_uom_qty")
def _compute_material_cost_to_consume(self):
for move in self:
- move.material_cost_to_consume = (
- move.product_standard_cost * move.product_uom_qty
- )
+ move.material_cost_to_consume = move.price_unit * move.product_uom_qty
- @api.depends("product_standard_cost", "quantity_done")
+ @api.depends("price_unit", "quantity_done")
def _compute_material_cost_consumed(self):
for move in self:
- move.material_cost_consumed = (
- move.product_standard_cost * move.quantity_done
- )
+ move.material_cost_consumed = move.price_unit * move.quantity_done
diff --git a/mrp_production_cost/views/mrp_production_views.xml b/mrp_production_cost/views/mrp_production_views.xml
index 5672e7caa..4eb1eefc8 100644
--- a/mrp_production_cost/views/mrp_production_views.xml
+++ b/mrp_production_cost/views/mrp_production_views.xml
@@ -5,19 +5,21 @@
-
-
-
+
+
+
-
- Cost Material to consume
-
-
- Cost Material consumed
-
@@ -25,16 +27,29 @@
mrp.production
-
-
-
-
-
+
+
+
+
-
+
+
diff --git a/mrp_production_cost/views/mrp_stockmove_views.xml b/mrp_production_cost/views/mrp_stockmove_views.xml
index d98a929a8..d98ece8b6 100644
--- a/mrp_production_cost/views/mrp_stockmove_views.xml
+++ b/mrp_production_cost/views/mrp_stockmove_views.xml
@@ -5,15 +5,17 @@
-
-
+
+
-
- Material cost to consume
-
-
- Material cost consumed
-
diff --git a/mrp_production_cost/views/mrp_workorder_views.xml b/mrp_production_cost/views/mrp_workorder_views.xml
index e12435fb0..cfe012b89 100644
--- a/mrp_production_cost/views/mrp_workorder_views.xml
+++ b/mrp_production_cost/views/mrp_workorder_views.xml
@@ -8,16 +8,18 @@
/>
-
-
-
+
+
+
-
- Workorder Cost estimated
-
-
- Workorder Cost real
-
diff --git a/setup/mrp_production_cost/odoo/addons/mrp_production_cost b/setup/mrp_production_cost/odoo/addons/mrp_production_cost
new file mode 120000
index 000000000..163f7ef00
--- /dev/null
+++ b/setup/mrp_production_cost/odoo/addons/mrp_production_cost
@@ -0,0 +1 @@
+../../../../mrp_production_cost
\ No newline at end of file
diff --git a/setup/mrp_production_cost/setup.py b/setup/mrp_production_cost/setup.py
new file mode 100644
index 000000000..28c57bb64
--- /dev/null
+++ b/setup/mrp_production_cost/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)