From 550f4be14ee30c1b887f65e8484e47636bfa650a Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 21 Mar 2011 17:56:41 +0530 Subject: [PATCH 1/3] [FIX] project_timesheet: Corrected date entry in yml. bzr revid: uco@tinyerp.com-20110321122641-rwaiv4wrq8p02hsf --- .../test/worktask_entry_to_timesheetline_entry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index f9af84d59e8..4cf790c4e2b 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -92,7 +92,7 @@ - !record {model: project.task, id: project_task_getalltimesheetrecords0}: work_ids: - - date: !eval time.strftime('%Y-07-%d %H:%M:%S') + - date: !eval time.strftime('%Y-06-%d %H:%M:%S') hours: 10.0 name: Get work calendar of all employees user_id: res_users_hrmanager0 From 8429d1fe580a6d4053d210fae08082a9794ae60e Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 21 Mar 2011 18:36:45 +0530 Subject: [PATCH 2/3] [FIX] project_long_term: Corrected Resource not found error. Corrected error when switching the views on project phases. bzr revid: uco@tinyerp.com-20110321130645-ey1i0ra2qpkzlfwu --- .../wizard/project_compute_phases.py | 2 +- addons/resource/resource.py | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/addons/project_long_term/wizard/project_compute_phases.py b/addons/project_long_term/wizard/project_compute_phases.py index 8e41baa9be7..2fc1aa69f60 100644 --- a/addons/project_long_term/wizard/project_compute_phases.py +++ b/addons/project_long_term/wizard/project_compute_phases.py @@ -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'][0], "default_project_id":data['project_id'][0], "search_default_responsible_id":uid, "search_default_current": 1} return result project_compute_phases() diff --git a/addons/resource/resource.py b/addons/resource/resource.py index 4bdc0caf22a..d2c284891ef 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -258,18 +258,17 @@ class resource_resource(osv.osv): leaves = [] resource_eff = 1.0 if resource_ids: - resource_id = resource_ids[0] - resource = self.browse(cr, uid, resource_id, context=context) - resource_eff = resource.time_efficiency - resource_cal = resource.calendar_id.id - if resource_cal: - leaves = self.compute_vacation(cr, uid, calendar_id, resource.id, resource_cal, context=context) - temp = { - 'name' : resource.name, - 'vacation': tuple(leaves), - 'efficiency': resource_eff, - } - resource_objs[resource_id] = temp + for resource in self.browse(cr, uid, resource_ids, context=context): + resource_eff = resource.time_efficiency + resource_cal = resource.calendar_id.id + if resource_cal: + leaves = self.compute_vacation(cr, uid, calendar_id, resource.id, resource_cal, context=context) + temp = { + 'name' : resource.name, + 'vacation': tuple(leaves), + 'efficiency': resource_eff, + } + resource_objs[resource.id] = temp # resource_objs.append(classobj(str(user.name), (Resource,),{ # '__doc__': user.name, # '__name__': user.name, From 354184110ad285aa5ed993149a1a5b8bba5bd8b0 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 21 Mar 2011 18:46:06 +0530 Subject: [PATCH 3/3] [FIX] project_long_term: Small Fix. bzr revid: uco@tinyerp.com-20110321131606-swxvwxe2hl1ekd8e --- addons/project_long_term/wizard/project_compute_phases.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/project_long_term/wizard/project_compute_phases.py b/addons/project_long_term/wizard/project_compute_phases.py index 2fc1aa69f60..7e84f0681cc 100644 --- a/addons/project_long_term/wizard/project_compute_phases.py +++ b/addons/project_long_term/wizard/project_compute_phases.py @@ -69,7 +69,8 @@ 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'][0], "default_project_id":data['project_id'][0], "search_default_responsible_id":uid, "search_default_current": 1} + project_id = data.get('project_id') and data.get('project_id')[0] or False + result['context'] = {"search_default_project_id":project_id, "default_project_id":project_id, "search_default_responsible_id":uid, "search_default_current": 1} return result project_compute_phases()