From e1becc32a7a5e86ff4918151692559b179970be2 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 8 Jul 2010 17:44:25 +0530 Subject: [PATCH] [IMP] project_mpr: create task from procurement, it takes that info + the time planned as sum of customer lead and manufcatoring time bzr revid: sbh@tinyerp.com-20100708121425-34l75ebg1j93cqli --- addons/project_mrp/mrp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/project_mrp/mrp.py b/addons/project_mrp/mrp.py index a45601e6245..eca7b283948 100644 --- a/addons/project_mrp/mrp.py +++ b/addons/project_mrp/mrp.py @@ -72,6 +72,7 @@ class procurement_order(osv.osv): self.write(cr, uid, [procurement.id], {'state': 'running'}) name_task = ('','') + planned_hours=0.0 if procurement.product_id.type == 'service': proc_name = procurement.name if procurement.origin == proc_name: @@ -80,12 +81,12 @@ class procurement_order(osv.osv): name_task = (procurement.origin, proc_name or '') else: name_task = (procurement.product_id.name or procurement.origin, procurement.name or '') - + planned_hours= procurement.product_id.sale_delay +procurement.product_id. produce_delay task_id = self.pool.get('project.task').create(cr, uid, { 'name': '%s:%s' % name_task, 'date_deadline': procurement.date_planned, - 'planned_hours': procurement.product_qty, - 'remaining_hours': procurement.product_qty, + 'planned_hours': planned_hours, + 'remaining_hours': planned_hours, 'user_id': procurement.product_id.product_manager.id, 'notes': "b"+(l and l.order_id.note or ''), 'procurement_id': procurement.id,