From 25041631f46595d8d9fb44852c9398b1b1cdd99a Mon Sep 17 00:00:00 2001 From: alfredoavanzosc Date: Thu, 10 Sep 2015 12:11:35 +0200 Subject: [PATCH] [IMP] mrp_production_project_estimated_cost: Show "Estimated Average Cost" field in mrp.production tree view. [IMP] mrp_production_real_cost: Show "Total Real Cost" field in mrp.production tree view. --- .../models/mrp_production.py | 4 ++-- .../views/mrp_production_view.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mrp_production_project_estimated_cost/models/mrp_production.py b/mrp_production_project_estimated_cost/models/mrp_production.py index ae5eedcce..0aecc3d4e 100644 --- a/mrp_production_project_estimated_cost/models/mrp_production.py +++ b/mrp_production_project_estimated_cost/models/mrp_production.py @@ -151,7 +151,7 @@ class MrpProduction(models.Model): @api.model def _prepare_cost_analytic_line( self, journal, name, production, product, general_account=None, - workorder=None, qty=1, std_cost=0, avg_cost=0): + workorder=None, qty=1, std_cost=0, avg_cost=0, amount=0): """ Prepare the vals for creating an analytic entry for stimated cost :param journal: Journal of the entry @@ -190,7 +190,7 @@ class MrpProduction(models.Model): 'date': analytic_line_obj._get_default_date(), 'product_id': product and product.id or False, 'unit_amount': qty, - 'amount': 0, + 'amount': amount, 'product_uom_id': product.uom_id.id, 'general_account_id': general_account.id, 'estim_std_cost': -qty * (std_cost or diff --git a/mrp_production_project_estimated_cost/views/mrp_production_view.xml b/mrp_production_project_estimated_cost/views/mrp_production_view.xml index 214df2194..72b797fde 100644 --- a/mrp_production_project_estimated_cost/views/mrp_production_view.xml +++ b/mrp_production_project_estimated_cost/views/mrp_production_view.xml @@ -52,6 +52,7 @@ +