diff options
| author | Olivier Dony <odo@openerp.com> | 2011-02-01 22:08:39 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2011-02-01 22:08:39 +0100 |
| commit | 3f96ef97a7406df2b839c1e532234f316fc66086 (patch) | |
| tree | 498225dda691535b036ad3d315b2854368ae9ee4 /addons/project/wizard/project_task_delegate.py | |
| parent | 1da43ed8ba2ea58bd9cfa8cea88f16baf249b7ef (diff) | |
[WIP] all: (work in progress) changing wizards to avoid using read() or at least take proper care of m2o fields
This is in preparation of the fix for m2o.get() on osv_memory objects, to make
it consistent with the regular read on osv objects. Previously on osv_memory
objects it was only returned the id, instead of the pair (id, name) as is appropriate
to avoid an additional name_get RPC call after each read.
Unfortunately many wizards were using direct read() instead of browse() and
relying on the fact that the returned dict contained a bare id value for
many2one fields.
bzr revid: odo@openerp.com-20110201210839-hwmk60ygksm805c4
Diffstat (limited to 'addons/project/wizard/project_task_delegate.py')
| -rw-r--r-- | addons/project/wizard/project_task_delegate.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py index 72b32f7db68..16c3ec85653 100644 --- a/addons/project/wizard/project_task_delegate.py +++ b/addons/project/wizard/project_task_delegate.py @@ -105,6 +105,8 @@ class project_task_delegate(osv.osv_memory): task_id = context.get('active_id', False) task_pool = self.pool.get('project.task') delegate_data = self.read(cr, uid, ids, context=context)[0] + if isinstance(delegate_data['user_id'], tuple): + delegate_data['user_id'] = delegate_data['user_id'][0] delegate_data['name'] = tools.ustr(delegate_data['name']) task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context) return {} |
