mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
Bugfixing: Always allow all operations when an empty recordset is passed
This commit is contained in:
@@ -22,7 +22,7 @@ class Base(models.AbstractModel):
|
||||
operations = ['read', 'create', 'write', 'unlink']
|
||||
result = {}
|
||||
for operation in operations:
|
||||
if self.is_transient() and not self.ids:
|
||||
if self.is_transient() or not self.ids:
|
||||
# If we call check_access_rule() without id, it will try to
|
||||
# run a SELECT without ID which will crash, so we just blindly
|
||||
# allow the operations
|
||||
|
||||
Reference in New Issue
Block a user