mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
Allow reactivate the security in a suspend security call.
This commit is contained in:
@@ -19,10 +19,10 @@ class Base(models.AbstractModel):
|
||||
self.env.context))
|
||||
|
||||
def sudo(self, user=SUPERUSER_ID):
|
||||
if isinstance(self.env.uid, BaseSuspendSecurityUid):
|
||||
if isinstance(user, BaseSuspendSecurityUid):
|
||||
return self.with_env(
|
||||
api.Environment(
|
||||
self.env.cr, BaseSuspendSecurityUid(user), self.env.context
|
||||
self.env.cr, user, self.env.context
|
||||
)
|
||||
)
|
||||
return super().sudo(user)
|
||||
|
||||
Reference in New Issue
Block a user