Skip to Content
Menu
This question has been flagged
2 Replies
902 Rodiniai

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?

Portretas
Atmesti
Autorius 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.

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
liep. 24
1301
0
birž. 25
479
2
liep. 25
516
3
rugs. 24
2553
1
liep. 24
1771