On 2016-06-09 05:16, Maxime Richez wrote:
> Hi everybody,
> 
> In my new module, i would like everyone can add a record and see records 
> from other people but only the creator of a record could modify his record. 
> Is it possible ?
> Here's is my rule, but it's not working : 
> 
> <record model="ir.model.access" id="access_mymodule">
>             <field name="model" search="[('model', '=', 'mymodule')]"/>
>             <field name="perm_read" eval="True"/>
>             <field name="perm_write" eval="False"/>
>             <field name="perm_create" eval="True"/>
>             <field name="perm_delete" eval="False"/>
>         </record>
> 
>         <record model="ir.rule.group" id="rule_group_creator_mymodule">
>             <field name="model" search="[('model', '=', 'mymodule')]"/>
>             <field name="global_p" eval="False"/>
>             <field name="default_p" eval="False"/>

As it is neither global nor default, are you sure you have added the
rule to a user when testing?

>             <field name="perm_write" eval="True"/>
>             <field name="perm_delete" eval="True"/>
>         </record>
>         <record model="ir.rule" id="rule_creator_mymodule">
>             <field name="domain"
>                 eval="[('create_uid', '=', Eval('user', {}).get('id', -1))]"
>                 pyson="1"/>
>             <field name="rule_group" ref="rule_group_creator_mymodule"/>
>         </record>

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20160609123900.GF23431%40tetsuo.

Reply via email to