[FIX] orm: make sure superuser mode always bypasses access rules filtering - one case was not covered after recent refactoring

Caused by refactoring in rev.4200
revid:odo@openerp.com-20120618094327

bzr revid: odo@openerp.com-20121112120453-axiul7k6y0o67hgb
This commit is contained in:
Olivier Dony 2012-11-12 13:04:53 +01:00
parent f033fddba0
commit 2a1381a8af
1 changed files with 2 additions and 0 deletions

View File

@ -3807,6 +3807,8 @@ class BaseModel(object):
cr.execute('SELECT id FROM ' + self._table + ' WHERE id IN %s', (tuple(missing_ids),))
if cr.rowcount:
# the missing ids are (at least partially) hidden by access rules
if uid == SUPERUSER_ID:
return
_logger.warning('Access Denied by record rules for operation: %s, uid: %s, model: %s', operation, uid, self._name)
raise except_orm(_('Access Denied'),
_('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \