Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Domain issue in record rule

By
René Schuster
on 1/8/14, 7:32 AM 1,317 views

I want project users only be able to see the projects in which they are member.
But since my project memberes are real employees, not users, I have added a bidirectional many2many project user relation. Also I have made a bidirectional user employee relation (one2 many, many2one).

Then I have create a record rule on the project user group with the following domain:

<field name="domain_force">[('member_ids', 'in', user.employee_ids[0].ids)]</field>

On projects list view the domain filter seems to work. Only the wanted projects are shown.
But when i try to open the form view of a project I get the following access denied error:

Access Denied
The requested operation cannot be completed due to security restrictions. 
Please contact your system administrator.
(Document type: Project, Operation: read)

Most likely the domain is wrong, but I don't get how to make it work...
Any help is highly appreciated.

EDIT: Regarding question 41777, the domain should be:

            [('member_ids.user_id', '=', user.id)]

But the issue remains the same..

0

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 2/27/14, 6:47 AM

Solved!

Both domain are working fine.

The issue was, that some project were depending on restricted models. Thus the form view threw the Access Denied Message.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 1/8/14, 7:32 AM
Seen: 1317 times
Last updated: 3/16/15, 8:10 AM