diff options
| author | jam-openerp <jam@tinyerp.com> | 2011-01-05 20:20:56 +0530 |
|---|---|---|
| committer | jam-openerp <jam@tinyerp.com> | 2011-01-05 20:20:56 +0530 |
| commit | 74910bba4ec6159499f98027e11bfe9a2cb6f23b (patch) | |
| tree | a79d84f9f52d13fdc3cddb70ea494a52fb1ea990 /addons/project_long_term/project_long_term.py | |
| parent | b9a70e1a7150e8be3568b981cc660cfe76c6add7 (diff) | |
[CHG] Project_long_term: Refactoring Scheduling Process.
bzr revid: jam@tinyerp.com-20110105145056-u88eik8isjnfj6md
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index fdec5c8a3dd..a793db6343e 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -229,7 +229,7 @@ class project_phase(osv.osv): avg_days = uom_pool._compute_qty(cr, uid, phase.product_uom.id, phase.duration, day_uom_id) duration = str(avg_days) + 'd' # Create a new project for each phase - str_resource = ('%s,'*len(phase.resource_ids))[:-1] + str_resource = ('%s | '*len(phase.resource_ids))[:-2] str_vals = str_resource % tuple(map(lambda x: 'Resource_%s'%x.resource_id.id, phase.resource_ids)) # Phases Defination for the Project s = ''' @@ -249,8 +249,7 @@ class project_phase(osv.osv): start = \"%s\" '''%(start) #start = datetime.strftime((datetime.strptime(start, "%Y-%m-%d")), "%Y-%m-%d") - - + phase_ids.append(phase.id) parent = False task_ids = [] @@ -510,8 +509,8 @@ def Project_%d(): for phase_id in phase_ids: act_phase = phase_pool.browse(cr, uid, phase_id, context=context) - print "============",act_phase phase = eval("project.Phase_%d" % phase_id) + start_date = phase.start.to_datetime() end_date = phase.end.to_datetime() if act_phase.task_ids: @@ -524,7 +523,9 @@ def Project_%d(): vals.update({'planned_hours' : str(temp._Task__calc_duration().strftime('%H.%M'))}) vals.update({'date_deadline' : str(temp._Task__calc_end().strftime('%Y-%m-%d %H:%M:%S'))}) task_pool.write(cr, uid, task.id, vals, context=context) - print ">>>>>",dir(temp) + + for i in dir(temp): + print "i**********", i,eval("project.Phase_%d.Task_%s.%s"%(phase_id,task.id,i)) print ">>>><<<<<<<<<<<<<<<<>",temp.booked_resource # Recalculate date_start and date_end @@ -684,7 +685,6 @@ class project_task(osv.osv): resource = False if task.user_id: resource_ids = self.search(cr, uid, [('user_id', '=', task.user_id.id),('resource_type','=','user')], context=context) - print "\n\n==========", task.user_id.name, resource_ids if len(resource_ids): resource = 'Resource_%s'%resource_ids[0] # Phases Defination for the Project |
