Merge pull request #10 from crnd-inc/11.0-fix-suspend-security

[11.0][FIX] suspend security incorrect uid in env
This commit is contained in:
Pedro M. Baeza
2018-08-07 07:13:35 +02:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -18,7 +18,7 @@
##############################################################################
{
"name": "Suspend security",
"version": "11.0.1.0.0",
"version": "11.0.1.0.1",
"author": "Therp BV, brain-tec AG, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Hidden/Dependency",

View File

@@ -12,4 +12,8 @@ class Base(models.AbstractModel):
@api.model
def suspend_security(self):
return self.sudo(user=BaseSuspendSecurityUid(self.env.uid))
return self.with_env(
api.Environment(
self.env.cr,
BaseSuspendSecurityUid(self.env.uid),
self.env.context))