diff options
| author | mso <mso@mso> | 2010-05-19 10:36:46 +0530 |
|---|---|---|
| committer | mso <mso@mso> | 2010-05-19 10:36:46 +0530 |
| commit | 67133e1dc40682ec11cf387c4ae576ee6d0752f7 (patch) | |
| tree | d416083797d9cbc51f162fe9731aa791ad91e149 /addons/project_long_term/project_long_term.py | |
| parent | 5f520738214952594d00c1d57f4b5773392143c4 (diff) | |
| parent | c99638ab487563e5166f897714200532dc0afca9 (diff) | |
[Merge] : branch merged with lp:openobject-addons
bzr revid: mso@mso-20100519050646-4sw308695vzaexed
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index deff634aa68..a925aeeb7aa 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -85,8 +85,8 @@ class project_phase(osv.osv): _columns = { 'name': fields.char("Phase Name", size=64, required=True), - 'date_start': fields.datetime('Starting Date'), - 'date_end': fields.datetime('End Date'), + 'date_start': fields.datetime('Starting Date', help="Start date of the phase"), + 'date_end': fields.datetime('End Date', help="End date of the phase"), 'constraint_date_start': fields.datetime('Start Date', help='force the phase to start after this date'), 'constraint_date_end': fields.datetime('End Date', help='force the phase to finish before this date'), 'project_id': fields.many2one('project.project', 'Project', required=True), @@ -104,8 +104,8 @@ class project_phase(osv.osv): } _defaults = { 'responsible_id': lambda obj,cr,uid,context: uid, - 'state': lambda *a: 'draft', - 'sequence': lambda *a: 10, + 'state': 'draft', + 'sequence': 10, } _order = "name" _constraints = [ @@ -237,7 +237,7 @@ class project_resource_allocation(osv.osv): 'useability': fields.float('Useability', help="Useability of this ressource for this project phase in percentage (=50%)"), } _defaults = { - 'useability': lambda *a: 100, + 'useability': 100, } project_resource_allocation() @@ -261,7 +261,7 @@ class task(osv.osv): 'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'), } _defaults = { - 'occupation_rate':lambda *a: '1' + 'occupation_rate': '1' } def onchange_planned(self, cr, uid, ids, project, user_id=False, planned=0.0, effective=0.0, date_start=None, occupation_rate=0.0): @@ -350,22 +350,22 @@ 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) task() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file |
