This question has been flagged

Version: Odoo 8

Problem: I get an Access Error when Portal Users try to view an issue.

Hint: It happens only if 'invoice working time on issues' is enabled.

Steps to reproduce the problem:

  1. Provide Portal Access to one of the customers

  2. Create a new Project and a Project Issue related to this customer and add this customer as a follower to the project and the issue

  3. Go to Settings --> Configuration --> Project and enable the option 'invoice working time on issues' under 'Helpdesk & Support '

  4. Login to the portal using the account of the aforementioned customer and try to view the issue

  5. Notice the error:

    AccessError

    Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:

    - Human Resources/Officer

    - Human Resources/Employee

    - Human Resources/Employee

    - Human Resources/Employee

    - Project/User

    - Project/User

    (Document model: hr.analytic.timesheet)

  6. Go to Settings --> Configuration --> Project and disable the option 'invoice working time on issues' under 'Helpdesk & Support ' 

  7. Login to the portal using the account of the aforementioned customer and try to view the issue. This time there is no error!

 

I submitted a bug report here:

https://github.com/odoo/odoo/issues/6800  

but is there any immediate solution I can apply to solve this?

Avatar
Discard
Author

I tried modifying the view in order to hide the timesheet related fields from the portal users using the groups attribute. Just for testing I tried modifying the file https://github.com/odoo/odoo/blob/8.0/addons/project_issue_sheet/project_issue_sheet_view.xml but with no luck. Is there any chance I can prevent the error by hiding the related fields using the groups attribute ?

Author Best Answer

Here is a workaround I used in order to avoid the Access Error.

Side Effect: Now portal users, also have access to the list of timesheets lines per project (but not to the list inside every issue or task!)

The workaround:

Through Settings --> Database Structure --> Models
I added Read access to Portal group for the Models:

  1. hr.analytic.timesheet

  2. account.analytic.line


If you have any better ideas, please share!

Avatar
Discard