[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
This commit is contained in:
sbh (Open ERP)
2010-07-08 17:44:25 +05:30
parent e1f0e06084
commit e1becc32a7
+4 -3
View File
@@ -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,