Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3816 Vizualizări

I have this issue in odoo10(not testing in previous version).

I have a model, and the record rule (only one record rule) for this model is without writing righ, xml definition as following :

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

      <field name="name">rule1</field>

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

      <field name="domain_force">[('create_uid','!=',user.id)]</field>

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

     <field eval="0" name="perm_unlink"/>

     <field eval="0" name="perm_write"/>

     <field eval="1" name="perm_read"/>

     <field eval="1" name="perm_create"/>   

</record>

Under such condition, I am able to modify the record which meeting the domain.

To avoid this, I have to add one anther record rule (different domain and perm_write=True )to make previous record un-writable, which is as following:

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

      <field name="name">rule2</field>

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

      <field name="domain_force">[('create_uid','=',user.id)]</field>

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

     <field eval="0" name="perm_unlink"/>

     <field eval="1" name="perm_write"/>

     <field eval="1" name="perm_read"/>

     <field eval="1" name="perm_create"/>   

</record>

 

Is this behavior as per design?If so, I have to add at least one another perm_xxxx=True rule for relevant rule which is perm_xxxx=False.

This really doesn't make sense. Do i misunderstand something ???

Imagine profil
Abandonează
Cel mai bun răspuns

Hi Jiaxin,
This is little bit confusing the way it is presented.

It is stated that you tested the first record rule that doesn't have write permission, and it is not working properly. Make sure that you done testing with users other than the admin.

Thank you

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iul. 25
4570
2
dec. 24
7719
2
nov. 24
28473
2
mai 24
7436
3
mar. 24
6864