summaryrefslogtreecommitdiff
path: root/addons/project_long_term/project_long_term.py
diff options
context:
space:
mode:
authorMantavya Gajjar <mga@tinyerp.com>2010-05-12 17:59:31 +0530
committerMantavya Gajjar <mga@tinyerp.com>2010-05-12 17:59:31 +0530
commit765d3baa2fe2516e54d0da7473459c9b581efdd1 (patch)
treec79bee30ff63e0c7e657baa9f89acd915130f7ad /addons/project_long_term/project_long_term.py
parentf4685de2b87f2ba68fc710c3f6a9712671332943 (diff)
parent80cc3fca7e51f8690bfeb265fe403eb53987fea8 (diff)
[MERGE]: merging from the same branch
bzr revid: mga@tinyerp.com-20100512122931-23f6dry5u0yxsd89
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
-rw-r--r--addons/project_long_term/project_long_term.py28
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)