Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
905 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
lug 24
1302
0
giu 25
480
2
lug 25
516
3
set 24
2553
1
lug 24
1772