Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
908 Prikazi

I have defined a custom grupo like this:

<record model="res.groups" id="group_grant_project_employee">
<field name="name">Project Employee</field>
<field name="category_id" ref="base.module_category_services_project"/>
</record>

I want to make the records that appear in the views of project.project invisible to the users of that group, and only show the records in which the user who accesses has tasks assigned. How can I do this?

Avatar
Opusti
Avtor Best Answer

Hi, I tried with what you mentioned but it didn't work, because there was a previous rule that overlapped because it applied to all internal users, I tried to inherit that rule but it was encapsulated in " <data noupdate="1"> " so the active value in False didn't work. To solve it I did the following using functions:

<function name="write" model="ir.model.data">
<value model="ir.model.data"
search="[('module', '=', 'project'), ('name', '=', 'project_public_members_rule')]"/>
<value eval="{'noupdate': False}"/>
</function>

<record id="project.project_public_members_rule" model="ir.rule">
<field name="active" eval="False"/>
</record>

<function name="write" model="ir.model.data">
<value model="ir.model.data"
search="[('module', '=', 'project'), ('name', '=', 'project_public_members_rule')]"/>
<value eval="{'noupdate': True}"/>
</function>

Thanks for your help, if you can close this please doit, because it says that i don't have enouhg XP.

Avatar
Opusti
Best Answer

Hi 

<record model="res.groups" id="group_grant_project_employee">

    <field name="name">Project Employee</field>

    <field name="category_id" ref="base.module_category_services_project"/>

</record>


1. Define a record rule for the project.project model to restrict access to projects based on task.


Hope it helps

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jul. 24
1302
0
jun. 25
480
2
jul. 25
520
3
sep. 24
2553
1
jul. 24
1772