diff options
| author | psi (Open ERP) <psi@tinyerp.co.in> | 2010-05-13 10:14:45 +0530 |
|---|---|---|
| committer | psi (Open ERP) <psi@tinyerp.co.in> | 2010-05-13 10:14:45 +0530 |
| commit | 8ad17345ba4b06c5938b5dd84fcdbdb7830aff38 (patch) | |
| tree | f4ea46b5dda3dcd1a55fd80cfc74dfb46edac8f9 /addons/project_long_term/project_long_term.py | |
| parent | 809ca998746df85118436b178250203b97aee569 (diff) | |
| parent | e19d54b84c05a927c1e8b19304942177fdb1ab4a (diff) | |
[MERGE] merge with dev3 branch
bzr revid: psi@tinyerp.co.in-20100513044445-qoveaysl25oiboxb
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index deff634aa68..8e67bc23766 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -350,20 +350,20 @@ class task(osv.osv): # Change the date_start and date_end # for previous and next tasks respectively based on valid condition - if vals.get('date_start', False) and vals['date_start'] < task_rec.date_start: - dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S') - work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, hrs or 0.0, resource.id or False) - if work_times: - vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') - for prv_task in task_rec.parent_ids: - self._check_date_start(cr, uid, prv_task, dt_start) - if vals.get('date_end', False) and vals['date_end'] > task_rec.date_end: - dt_end = mx.DateTime.strptime(vals['date_end'], '%Y-%m-%d %H:%M:%S') - work_times = resource_calendar_obj.interval_min_get(cr, uid, calendar_id, dt_end, hrs or 0.0, resource.id or False) - if work_times: - vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S') - for next_task in task_rec.child_ids: - self._check_date_end(cr, uid, next_task, dt_end) + if vals.get('date_start', False) and vals['date_start'] < task_rec.date_start: + dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S') + work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, hrs or 0.0, resource.id or False) + if work_times: + vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S') + for prv_task in task_rec.parent_ids: + self._check_date_start(cr, uid, prv_task, dt_start) + if vals.get('date_end', False) and vals['date_end'] > task_rec.date_end: + dt_end = mx.DateTime.strptime(vals['date_end'], '%Y-%m-%d %H:%M:%S') + work_times = resource_calendar_obj.interval_min_get(cr, uid, calendar_id, dt_end, hrs or 0.0, resource.id or False) + if work_times: + vals['date_start'] = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S') + for next_task in task_rec.child_ids: + self._check_date_end(cr, uid, next_task, dt_end) return super(task, self).write(cr, uid, ids, vals, context=context) |
