Allow reactivate the security in a suspend security call.

This commit is contained in:
Monica Diaz Pena
2020-01-06 15:53:07 -05:00
parent 8f24e9e776
commit 77be6275b1

View File

@@ -19,10 +19,10 @@ class Base(models.AbstractModel):
self.env.context)) self.env.context))
def sudo(self, user=SUPERUSER_ID): def sudo(self, user=SUPERUSER_ID):
if isinstance(self.env.uid, BaseSuspendSecurityUid): if isinstance(user, BaseSuspendSecurityUid):
return self.with_env( return self.with_env(
api.Environment( api.Environment(
self.env.cr, BaseSuspendSecurityUid(user), self.env.context self.env.cr, user, self.env.context
) )
) )
return super().sudo(user) return super().sudo(user)