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

I'm going through access rules tutorial \https://www.odoo.com/documentation/14.0/developer/howtos/rdtraining/B_acl_irrules.html#access-rules

please someone tell me how to paste XML code here in a way it doesn't trim the tags away. I can't even show example of the rule, but you will find it in the link above


It's written that this rule 

Only applies to the “create”, “update” (write) and “delete” (unlink) operations: here we want every employee to be able to see other users’ records but only the author / assignee can update a record.


I don't get it. We haven't even written anything about create/update/unlink in the rule, why does it apply to those operations? Also, the code says (I think) that when the domain is met, read permission should be false, which doesn't make sense at all.

Please explain.

Avatar
Zrušit
Nejlepší odpověď

Hi Ameus:

Since the XML does not explicitly specify a value for perm_write, perm_create and perm_unlink, Odoo will assign the default values (True) to these fields when the rule is created.

Here's a link to the code that defines these fields: https://github.com/odoo/odoo/blob/14.0/odoo/addons/base/models/ir_rule.py#L13


Regarding your second question, the rule seems to be just a sample to illustrate the syntax and not an actual working rule. For example, the "ref" is pointing to "model_to_manage".

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
čvn 25
449
0
led 25
1579
0
led 25
1595
1
pro 24
2153
2
lis 24
1722