Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1088 Zobrazení

Hello, 

I have a group of users I would like to only see (create, update, delete) contact records that were created by them, AND, contact records created by others which have a specific field attribute (for example, field relationship = shared).


I am assuming this is to be implemented with record rules, but I am coming up short on expressing the rule to achieve that. 


I am using Odoo SaaS (Cloud). 


Any recommendations on how to best approach this scenario is greatly welcome.

Avatar
Zrušit
Autor Nejlepší odpověď

Thanks for your comment. Can this be an expression instead of writing an xml? I use Odoo SaaS in the cloud, and thought I´d be able to express this under Settings->Technical->Security->Record Rules

Avatar
Zrušit
Nejlepší odpověď

Hi,


Create record rule as follows:

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

    <field name="name">Contact Limited Access</field>

    <field name="model_id" ref="base.model_res_partner"/>

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

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

</record>


Hope it helps

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 24
1352
0
úno 24
1314
0
srp 21
2251
1
čvn 19
4131
1
zář 20
5757