[FIX] project_issue: fix access rights error when using portal access

Due to the recent change in the computation of the closing duration
for project issues[1], viewing issues now fails for users who do not
have read access to project.project. This is typically the case for
portal users, who can view their own issues but not the project details.
Doing the computation in superuser mode does not cause any security
problem and avoids the access rights error.

bzr revid: odo@openerp.com-20121107141219-0g9d2d5j6z4ta1ce
This commit is contained in:
Olivier Dony
2012-11-07 15:12:19 +01:00
parent ac593d88d0
commit 2f0a57f7ea
+1 -1
View File
@@ -100,7 +100,7 @@ class project_issue(crm.crm_case, osv.osv):
res_obj = self.pool.get('resource.resource')
res = {}
for issue in self.browse(cr, uid, ids, context=context):
for issue in self.browse(cr, 1, ids, context=context):
# if the working hours on the project are not defined, use default ones (8 -> 12 and 13 -> 17 * 5), represented by None
if not issue.project_id or not issue.project_id.resource_calendar_id: