Skip to Content
Menu
This question has been flagged
3 Replies
6021 Views

I want the users of the groups group_project_user in the module project  to just see these own tasks

here is my code that I do but it does not work, user sees all the tasks

<odoo>

     <record model="ir.rule" id="project_rules_tasks">
             <field name="name">Projet rules taches user</field>
             <field name="model_id" ref="model_project_task"></field>
             <field name="groups" eval="[(4,ref('project.group_project_user'))]"></field>
             <field name="domain_force">[('user_id','=',user.id)]</field>
  </record>
</odoo>

I declared my file in manifest
Avatar
Discard
Best Answer

You can inactive that rule using below code instead of removing it. 

<record id="project.task_visibility_rule" model="ir.rule">

        <field name="active" eval="False"/>

    </record>

Avatar
Discard
Author Best Answer

after a search I must to delete this  record rules  which is by default in list of  record rules

    <record model="ir.rule" id="task_visibility_rule">

        <field name="name">Project/Task: employees: follow required for follower-only projects</field>

        <field name="model_id" ref="model_project_task"/>

        <field name="domain_force">[

        '|',

            ('project_id.privacy_visibility', '!=', 'followers'),

            '|',

                ('project_id.message_partner_ids', 'in', [user.partner_id.id]),

                '|',

                    ('message_partner_ids', 'in', [user.partner_id.id]),

                    # to subscribe check access to the record, follower is not enough at creation

                    ('user_id', '=', user.id)

        ]</field>

        <field name="groups" eval="[(4,ref('base.group_user'))]"/>

    </record>


how to remove this record rules ??

Avatar
Discard
Best Answer

try to add this two lines into your code
 <data noupdate="1">
</data >
like this

<odoo>
 <data noupdate="1">
     <record model="ir.rule" id="project_rules_tasks">
             <field name="name">Projet rules taches user</field>
             <field name="model_id" ref="model_project_task"></field>
             <field name="groups" eval="[(4,ref('project.group_project_user'))]"></field>
             <field name="domain_force">[('user_id','=',user.id)]</field>
  </record>
</data >
</odoo>

Avatar
Discard