[MERGE] project fix some error

bzr revid: tfr@openerp.com-20110322111513-65csvxd4as2fq6i1
This commit is contained in:
Thibault Francois
2011-03-22 12:15:13 +01:00
3 changed files with 14 additions and 14 deletions
@@ -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'], "default_project_id":data['project_id'], "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()
@@ -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
+11 -12
View File
@@ -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,