mirror of https://github.com/OCA/social.git
[FIX] mail_gateway: Pass company in order to ensure that it is executed properly
parent
9471bd53df
commit
7c0e580e05
|
@ -32,6 +32,7 @@ class GatewayController(Controller):
|
|||
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(
|
||||
|
|
|
@ -113,7 +113,7 @@ class MailGateway(models.Model):
|
|||
@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),
|
||||
|
@ -125,6 +125,7 @@ class MailGateway(models.Model):
|
|||
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,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue