diff options
| author | mra (Open ERP) <mra@tinyerp.com> | 2010-03-16 15:00:14 +0530 |
|---|---|---|
| committer | mra (Open ERP) <mra@tinyerp.com> | 2010-03-16 15:00:14 +0530 |
| commit | 4f7ece5e75b7cb0dbd730fbb9f4a5119c5d7d7b2 (patch) | |
| tree | 64ff310fafe52ef5e2634d7e6d95a8cf3bc94411 /addons/project_long_term/project_long_term.py | |
| parent | f256181d97f7cfda68797d83226993a9460ce69f (diff) | |
[IMP] project_long_term: improve the code
bzr revid: mra@tinyerp.com-20100316093014-m1t1z0nb8j05s8x9
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 48129f40bb8..ea11df9f9bd 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -136,7 +136,9 @@ class project_phase(osv.osv): calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False resource_id = resource_obj.search(cr, uid, [('user_id', '=', phase.responsible_id.id)]) if resource_id: - cal_id = resource_obj.browse(cr, uid, resource_id[0], context=context).calendar_id.id +# cal_id = resource_obj.browse(cr, uid, resource_id[0], context=context).calendar_id.id + res = resource_obj.read(cr, uid, resource_id[0], ['calendar_id'], context=context)[0] + cal_id = res.get('calendar_id', False) and res.get('calendar_id')[0] or False if cal_id: calendar_id = cal_id default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')], context=context)[0] @@ -155,7 +157,9 @@ class project_phase(osv.osv): calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False resource_id = resource_obj.search(cr, uid, [('user_id', '=', phase.responsible_id.id)], context=context) if resource_id: - cal_id = resource_obj.browse(cr, uid, resource_id[0], context=context).calendar_id.id +# cal_id = resource_obj.browse(cr, uid, resource_id[0], context=context).calendar_id.id + res = resource_obj.read(cr, uid, resource_id[0], ['calendar_id'], context=context)[0] + cal_id = res.get('calendar_id', False) and res.get('calendar_id')[0] or False if cal_id: calendar_id = cal_id default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')], context=context)[0] |
