summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorXavier-Do <xdo@odoo.com>2019-04-01 14:06:24 +0000
committerXavier-Do <xdo@odoo.com>2019-04-02 15:39:30 +0000
commitb5c20041604623a87dfb83a3da0b0bdfd8b3c8d8 (patch)
treefbb0798911750741685ec2d598f483ac579245c0 /odoo/models.py
parentedef08eeee688912040839dd073c1852b2d5219f (diff)
[IMP] core: avoid to check access rules on empty recordset
Checking access rules only makes sence if we have some records, _filter_access_rules will always return a subset or current recordset, and a subset or a empty recordset is an empty recordset. closes odoo/odoo#32313 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/models.py')
-rw-r--r--odoo/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/models.py b/odoo/models.py
index b1cb70599c9..7178f27f24c 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -3102,6 +3102,9 @@ Fields:
if self._uid == SUPERUSER_ID:
return self
+ if not self._ids:
+ return self
+
if self.is_transient():
# Only one single implicit access rule for transient models: owner only!
# This is ok to hardcode because we assert that TransientModels always