Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
909 Переглядів

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?

Аватар
Відмінити
Автор Найкраща відповідь

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.

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лип. 24
1302
0
черв. 25
480
2
лип. 25
520
3
вер. 24
2553
1
лип. 24
1772