From 269dbc98727c2efa1d79b0f95653b2b5b0087a48 Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Fri, 3 Feb 2017 15:42:47 +0100 Subject: [PATCH] [IMP] model: log a message when an AccessError happens With the user who is trying to access and the record they are trying to access to. This way it is easier to understand the reason of the error. Do not show record and user ids in the popup as it is a technical information. Closes #13030 --- odoo/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/odoo/models.py b/odoo/models.py index f352dae45cc..6327199c9a3 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -3097,6 +3097,9 @@ class BaseModel(object): _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \ (self._name, 'read') ) + _logger.info( + _('The requested operation cannot be completed due to record rules: Document type: %s, Operation: %s, Records: %s, User: %s') % \ + (self._name, 'read', ','.join([str(r.id) for r in self][:6]), self._uid)) forbidden._cache.update(FailedValue(exc)) @api.multi