From 9342235fd4cc7137163892d08309b3cebf53be25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rahir?= Date: Mon, 1 Oct 2018 16:26:05 +0200 Subject: [PATCH] [FIX] iap: remove temporary hack from 11.0 Remove the sudo create introduced in 2bf1af77fbb232c2e09059ea68a4b62fb7b582bd as we added corrects security access. --- addons/iap/models/iap.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/iap/models/iap.py b/addons/iap/models/iap.py index c5364ee4101..0dd205f663e 100644 --- a/addons/iap/models/iap.py +++ b/addons/iap/models/iap.py @@ -151,8 +151,7 @@ class IapAccount(models.Model): def get(self, service_name): account = self.search([('service_name', '=', service_name), ('company_id', 'in', [self.env.user.company_id.id, False])]) if not account: - # TODO: remove this sudo in v12 as we change the user rights. - account = self.sudo().create({'service_name': service_name}).with_env(self.env) + account = self.create({'service_name': service_name}) # Since the account did not exist yet, we will encounter a NoCreditError, # which is going to rollback the database and undo the account creation, # preventing the process to continue any further.