Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
906 Представления

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
516
3
сент. 24
2553
1
июл. 24
1772