[FIX] base: address operation context keys in calendar view

Prior this fix, creating an action with (e.g.)
additional_context : {create: 0} wouldn't have any effect
on calendar view.

Now, if this context key is added, the user won't be able to create.
Also true for delete and write.

closes odoo/odoo#97538

X-original-commit: 8d108f32b8333f0698427f9a7f12765c8addd8ae
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
Audric Onockx (auon)
2022-08-05 04:45:02 +02:00
parent 92e700fc08
commit bc880f2af0
+1 -1
View File
@@ -1121,7 +1121,7 @@ actual arch.
# testing ACL as real user
is_base_model = self.env.context.get('base_model_name', model._name) == model._name
if node.tag in ('kanban', 'tree', 'form', 'activity'):
if node.tag in ('kanban', 'tree', 'form', 'activity', 'calendar'):
for action, operation in (('create', 'create'), ('delete', 'unlink'), ('edit', 'write')):
if (not node.get(action) and
not model.check_access_rights(operation, raise_exception=False) or