diff options
| author | rha@tinyerp.com <> | 2011-02-07 11:58:04 +0530 |
|---|---|---|
| committer | rha@tinyerp.com <> | 2011-02-07 11:58:04 +0530 |
| commit | bf1b45c2bc7f10bac51030294d72e4a78fe4e99a (patch) | |
| tree | a7ed83af8ac1f62ab9c33431498517ce902cd376 /addons/project_long_term | |
| parent | 87ff4b3c97b2d363228e0495c6f1bab2058930d9 (diff) | |
| parent | 3f96ef97a7406df2b839c1e532234f316fc66086 (diff) | |
[Merge] : Merge with lp:~openerp/openobject-addons/trunk-fix-osvmem-read
bzr revid: rha@tinyerp.com-20110207062804-o766jmppnvjwi7hj
Diffstat (limited to 'addons/project_long_term')
| -rw-r--r-- | addons/project_long_term/wizard/project_compute_phases.py | 10 | ||||
| -rw-r--r-- | addons/project_long_term/wizard/project_compute_tasks.py | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/addons/project_long_term/wizard/project_compute_phases.py b/addons/project_long_term/wizard/project_compute_phases.py index c07f1ae81be..b074f3c93e9 100644 --- a/addons/project_long_term/wizard/project_compute_phases.py +++ b/addons/project_long_term/wizard/project_compute_phases.py @@ -45,12 +45,12 @@ class project_compute_phases(osv.osv_memory): Compute the phases for scheduling. """ project_pool = self.pool.get('project.project') - data = self.read(cr, uid, ids, [], context=context)[0] - if not data['project_id'] and data['target_project'] == 'one': + data = self.browse(cr, uid, ids, context=context)[0] + if not data.project_id and data.target_project == 'one': raise osv.except_osv(_('Error!'), _('Please Specify Project to be schedule')) - if data['project_id']: # If project mentioned find its phases - project_ids = [data['project_id']] + if data.project_id: # If project mentioned find its phases + project_ids = [data.project_id.id] else: # Else take all the draft,open,pending states phases project_ids = project_pool.search(cr, uid, [], context=context) @@ -69,7 +69,7 @@ class project_compute_phases(osv.osv_memory): id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] result = act_obj.read(cr, uid, [id], context=context)[0] result['target'] = 'current' - result['context'] = {"search_default_project_id":data['project_id'], "default_project_id":data['project_id'], "search_default_responsible_id":uid, "search_default_current": 1} + result['context'] = {"search_default_project_id":data.project_id.id or False, "default_project_id":data.project_id.id or False, "search_default_responsible_id":uid, "search_default_current": 1} return result project_compute_phases() diff --git a/addons/project_long_term/wizard/project_compute_tasks.py b/addons/project_long_term/wizard/project_compute_tasks.py index 658350a27d2..d5cc4eb5991 100644 --- a/addons/project_long_term/wizard/project_compute_tasks.py +++ b/addons/project_long_term/wizard/project_compute_tasks.py @@ -37,8 +37,8 @@ class project_compute_tasks(osv.osv_memory): if context is None: context = {} context['compute_by'] = 'project' - data = self.read(cr, uid, ids, [])[0] - project_id = data['project_id'] + data = self.browse(cr, uid, ids)[0] + project_id = data.project_id.id project_pool.schedule_tasks(cr, uid, [project_id], context=context) return self._open_task_list(cr, uid, data, context=context) |
