Skip to content

Commit

Permalink
Merge PR OCA#1444 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 12, 2024
2 parents c76689c + 7c0e580 commit fdc0c60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions mail_gateway/controllers/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def post_update(self, usage, token, *args, **kwargs):
return (
request.env["mail.gateway.%s" % usage]
.with_user(bot_data["webhook_user_id"])
.with_company(bot_data["company_id"])
._receive_get_update(bot_data, request, **kwargs)
)
bot_data = request.env["mail.gateway"]._get_gateway(
Expand Down
3 changes: 2 additions & 1 deletion mail_gateway/models/mail_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def create(self, mvals):
@tools.ormcache()
def _get_gateway_map(self, state="integrated", gateway_type=False):
result = {}
for record in self.search(
for record in self.sudo().search(
[
("integrated_webhook_state", "=", state),
("gateway_type", "=", gateway_type),
Expand All @@ -125,6 +125,7 @@ def _get_gateway_map(self, state="integrated", gateway_type=False):
def _get_gateway_data(self):
return {
"id": self.id,
"company_id": self.company_id.id,
"webhook_secret": self.webhook_secret,
"webhook_user_id": self.webhook_user_id.id,
}
Expand Down

0 comments on commit fdc0c60

Please sign in to comment.