[FIX] ir_model_access: missing flush() before SQL query

X-original-commit: ba1d04ac8a23a2f3cfad7f332dab96f7e460eb53
This commit is contained in:
Raphael Collet
2020-02-08 18:55:14 +00:00
parent fe6a45945a
commit c732a5e44f
+2
View File
@@ -1534,6 +1534,8 @@ class IrModelAccess(models.Model):
if model not in self.env:
_logger.error('Missing model %s', model)
self.flush(self._fields)
# We check if a specific rule exists
self._cr.execute("""SELECT MAX(CASE WHEN perm_{mode} THEN 1 ELSE 0 END)
FROM ir_model_access a