Skip to content

Commit 0bf2eca

Browse files
[FIX] base_api_connection: add sudo() for search
1 parent 60d29b0 commit 0bf2eca

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

base_api_connection/models/api_call_mixin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ def make_api_call(
3030
json=None,
3131
http_method="get",
3232
):
33-
config = self.env["api.config"].search(
34-
[("external_system", "=", external_system), ("code", "=", code)], limit=1
33+
config = (
34+
self.env["api.config"]
35+
.sudo()
36+
.search(
37+
[("external_system", "=", external_system), ("code", "=", code)],
38+
limit=1,
39+
)
3540
)
3641
if not config:
3742
raise UserError(_("API configuration not found."))

0 commit comments

Comments
 (0)