Hi there,
We recently migrated from Odoo 13 to 15. We observed that on triggering a server action in Odoo 15, it is checking if the user has 'write' access on the selected contacts.
In our case, the server action is used to send out emails to the contacts and doesn't have the 'write' privilege on the contacts. But, because of this restriction, the server action is failing.
May I know the reason why this 'write' acess check is added in the execution of a server action.
Here is the related code I found from ir_actions.py
eval_context = self._get_eval_context(action)
records = eval_context.get('record') or eval_context['model']
records |= eval_context.get('records') or eval_context['model']
if records:
try:
records.check_access_rule('write')
except AccessError:
_logger.warning("Forbidden server action %r executed while the user %s does not have access to %s.",
action.name, self.env.user.login, records,
)
raise