Files
server-backend/base_suspend_security/models/ir_model_access.py
2019-02-21 15:23:34 +01:00

19 lines
669 B
Python

# © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models, tools
from ..base_suspend_security import BaseSuspendSecurityUid
class IrModelAccess(models.Model):
_inherit = 'ir.model.access'
@api.model
@tools.ormcache_context('self._uid', 'model', 'mode', 'raise_exception',
keys=('lang',))
def check(self, model, mode='read', raise_exception=True):
if isinstance(self.env.uid, BaseSuspendSecurityUid):
return True
return super(IrModelAccess, self).check(
model, mode=mode, raise_exception=raise_exception)