Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
a15f060
[ADD] mail_broker
olgamarcocb Dec 15, 2021
73c2105
[IMP] mail_broker: Set webhook
etobella Dec 16, 2021
4669904
[IMP] mail_broker
olgamarcocb Jun 9, 2022
43719cd
[IMP] mail_broker: Black, isort, prettier
etobella Nov 30, 2022
92ee18f
[MIG] mail_broker: Migration to 14.0
etobella Nov 30, 2022
1d2ed8b
[IMP] mail_broker: Black, isort, prettier
etobella Jan 29, 2024
69e4807
[MIG] mail_gateway: Migration to 16.0
etobella Jan 29, 2024
48400db
Added translation using Weblate (Italian)
mymage May 27, 2024
574f1e6
Added translation using Weblate (Spanish)
anmarmo1 May 28, 2024
af458f8
Translated using Weblate (Italian)
mymage Jul 2, 2024
34ced58
[FIX] mail_gateway: Pass company in order to ensure that it is execut…
etobella Jul 17, 2024
62fc1a1
[IMP] mail_gateway: Allow usage of mail templates on gateway
etobella Sep 12, 2024
ec415ec
[FIX] mail_gateway: dummy compatibility with m2m fields
chienandalu Nov 7, 2024
de6c8fb
Translated using Weblate (Italian)
mymage Nov 12, 2024
309cb64
Translated using Weblate (Spanish)
imoralesc Nov 14, 2024
3d401be
[IMP] mail_gateway: Fine-tune default values for gateway behavior rel…
carlos-lopez-tecnativa Nov 18, 2024
87b18a2
[IMP] mail_gateway: pre-commit auto fixes
chienandalu Mar 19, 2025
0c93159
[MIG] mail_gateway: Migration to 17.0
chienandalu Mar 19, 2025
7d88dfe
[UPD] Update mail_gateway.pot
Jul 22, 2025
d6fa210
[BOT] post-merge updates
OCA-git-bot Jul 22, 2025
ca52f5e
[IMP] mail_gateway: pre-commit auto fixes
CarlosRoca13 Jul 24, 2025
41d6395
[MIG] mail_gateway: Migration to 18.0
CarlosRoca13 Aug 6, 2025
b825fcb
[MIG] mail_gateway: Migration to 18.0
CarlosRoca13 Aug 13, 2025
fad1d84
[UPD] Update mail_gateway.pot
Aug 21, 2025
09b2534
[BOT] post-merge updates
OCA-git-bot Aug 21, 2025
77de055
[FIX] mail_gateway: Messages are not being sent using the email messa…
CarlosRoca13 Aug 21, 2025
e8fe06b
[BOT] post-merge updates
OCA-git-bot Aug 21, 2025
52f48b3
[FIX] mail_gateway: Error when trying to edit a message
CarlosRoca13 Aug 21, 2025
5b96aed
Merge PR #1709 into 18.0
OCA-git-bot Aug 21, 2025
ea48869
[BOT] post-merge updates
OCA-git-bot Aug 21, 2025
8f469ce
[IMP] mail_gateway: Simplify button label from 'Gateway message' to '…
carlos-lopez-tecnativa Oct 15, 2025
a85731b
[BOT] post-merge updates
OCA-git-bot Oct 15, 2025
8b4b7e0
Update translation files
weblate Oct 15, 2025
c6ab9d8
Translated using Weblate (Italian)
mymage Oct 16, 2025
e6ae8c0
mail_gateway: fix charset error for Werkzeug 2.1+
geomer198 Dec 30, 2025
0198de4
[FIX] mail_gateway: memeber does not have userId
eduezerouali-tecnativa Dec 29, 2025
49775b9
[BOT] post-merge updates
OCA-git-bot Dec 30, 2025
0b54e20
[IMP] mail_gateway: add two new threadActionsRegistry
eduezerouali-tecnativa Sep 23, 2025
4cb3ab8
Merge PR #1731 into 18.0
OCA-git-bot Dec 30, 2025
6017db8
[UPD] Update mail_gateway.pot
Dec 30, 2025
b8c027e
[BOT] post-merge updates
OCA-git-bot Dec 30, 2025
cf22a88
Update translation files
weblate Dec 30, 2025
19cad87
Translated using Weblate (Spanish)
pedrobaeza Dec 30, 2025
570069e
Translated using Weblate (Spanish)
eduezerouali-tecnativa Dec 30, 2025
2eafa25
Translated using Weblate (Italian)
mymage Jan 5, 2026
ece87ab
Merge PR #1783 into 18.0
OCA-git-bot Jan 7, 2026
4d18d59
[BOT] post-merge updates
OCA-git-bot Jan 7, 2026
b0e67b0
[IMP] mail_gateway: Handle and display errors when sending a message …
carlos-lopez-tecnativa Sep 2, 2025
c9658ed
[IMP] mail_gateway_whatsapp: Handle webhook updates for message statu…
carlos-lopez-tecnativa Sep 2, 2025
4def88c
[UPD] Update mail_gateway.pot
Feb 2, 2026
7038e10
[BOT] post-merge updates
OCA-git-bot Feb 2, 2026
cacdbdf
Update translation files
weblate Feb 2, 2026
0bb8996
Translated using Weblate (Italian)
mymage Feb 4, 2026
e0d854f
Translated using Weblate (Spanish)
Ed-Spain Apr 12, 2026
7954d2d
[IMP] mail_gateway: only show chatter button to gateway users
luisDIXMIT Mar 25, 2026
ff063f6
[FIX] mail_gateway: Adapt onFocusIn signature
pedrobaeza Apr 13, 2026
ebfb491
[BOT] post-merge updates
OCA-git-bot Apr 13, 2026
bc51c56
Added translation using Weblate (Galician)
chavaone Apr 23, 2026
ce9362e
Translated using Weblate (Galician)
chavaone Apr 26, 2026
783614f
Translated using Weblate (Spanish)
Ed-Spain May 4, 2026
3ad7157
[FIX] mail_gateway: notifications are added when linking a message fr…
CarlosRoca13 Sep 4, 2025
a5427dc
[BOT] post-merge updates
OCA-git-bot May 14, 2026
a5b815c
Translated using Weblate (Galician)
chavaone May 21, 2026
1b00dd2
Translated using Weblate (Galician)
chavaone May 29, 2026
67d4b9b
Add 'mail_gateway/' from commit '1b00dd2069593353cfebc758a9f0541ff9ea…
DucTruongKomit Jun 1, 2026
33a1649
[MIG] mail_gateway: Migration to 19.0
DucTruongKomit Jun 1, 2026
6252ff7
[ADD] mail_broker_whatsapp
olgamarcocb May 25, 2022
7cb29a5
[IMP] mail_broker_whatsapp: Improve phone widget
etobella Jul 11, 2022
4d4ceef
[IMP] mail_broker_whatsapp: Manage change of version of Facebook API
marcelsavegnago Nov 14, 2022
7faa213
[FIX] mail_broker_whatsapp: pre-commit changes
etobella Nov 30, 2022
a0d3b2a
[IMP] mail_broker_whatsapp: Black, isort, prettier
etobella Feb 19, 2024
7ca2022
[MIG] mail_broker_whatsapp: Migration to 16.0
etobella Feb 21, 2024
5564426
Added translation using Weblate (Italian)
mymage May 27, 2024
0419aa0
Added translation using Weblate (Spanish)
FranciscoFactorLibre Oct 3, 2024
18cc249
Translated using Weblate (Spanish)
PabloMartin32 Nov 14, 2024
89acf0b
[IMP] mail_gateway_whatsapp: Add support for WhatsApp templates If th…
carlos-lopez-tecnativa Nov 12, 2024
e187387
[IMP] mail_gateway: Fine-tune default values for gateway behavior rel…
carlos-lopez-tecnativa Nov 18, 2024
52b880e
Translated using Weblate (Italian)
mymage Jan 9, 2025
37db706
[IMP] mail_gateway_whatsapp: pre-commit auto fixes
chienandalu Mar 18, 2025
eb2ac0a
[MIG] mail_gateway_whatsapp: Migration to 17.0
chienandalu Mar 18, 2025
3e42e15
[UPD] Update mail_gateway_whatsapp.pot
Jul 23, 2025
2d78fa2
[BOT] post-merge updates
OCA-git-bot Jul 23, 2025
519f502
[IMP] mail_gateway_whatsapp: pre-commit auto fixes
CarlosRoca13 Aug 6, 2025
02a3a0f
[MIG] mail_gateway_whatsapp: Migration to 18.0
CarlosRoca13 Aug 8, 2025
e01cf6f
[UPD] Update mail_gateway_whatsapp.pot
Aug 21, 2025
5cb3817
[BOT] post-merge updates
OCA-git-bot Aug 21, 2025
c5e9385
[IMP] mail_gateway_whatsapp: Handle webhook updates for message statu…
carlos-lopez-tecnativa Sep 2, 2025
6433760
[IMP] mail_gateway_whatsapp: Handle errors when the message is not se…
carlos-lopez-tecnativa Feb 2, 2026
0bd87af
[BOT] post-merge updates
OCA-git-bot Feb 2, 2026
b3c8cfb
[IMP] mail_gateway_whatsapp: Add support for buttons and variables in…
carlos-lopez-tecnativa Sep 11, 2025
b7ed34c
[UPD] Update mail_gateway_whatsapp.pot
Feb 26, 2026
af6aed7
[BOT] post-merge updates
OCA-git-bot Feb 26, 2026
92da4f2
Update translation files
weblate Feb 26, 2026
990063f
[IMP] mail_gateway_whatsapp: Add support for messages in server actions
pedrobaeza Dec 24, 2025
15fccd4
[FIX] mail_gateway_whatsapp: Avoid singleton error when creating channel
pedrobaeza Feb 25, 2026
46a3d91
[UPD] Update mail_gateway_whatsapp.pot
Mar 2, 2026
bcb1dbb
[BOT] post-merge updates
OCA-git-bot Mar 2, 2026
670e812
Update translation files
weblate Mar 2, 2026
826dfc0
Translated using Weblate (Italian)
mymage Mar 2, 2026
db2d3f7
Use the existing template to process imported data.
bartacruz Mar 25, 2026
52a6c24
[BOT] post-merge updates
OCA-git-bot Mar 27, 2026
e427737
[18.0][FIX] mail_gateway_whatsapp: Mark incomming audios as voice. Wi…
bartacruz Mar 28, 2026
83b0ddb
[BOT] post-merge updates
OCA-git-bot Mar 31, 2026
2b863da
Translated using Weblate (Spanish)
Ed-Spain Apr 12, 2026
d1293bf
[FIX] mail_gateway_whatsapp: Add parent_id when message is a response.
bartacruz Apr 9, 2026
613326f
[FIX] mail_gateway_whatsapp: put captions of attachments into message…
bartacruz Mar 28, 2026
62c12d9
[BOT] post-merge updates
OCA-git-bot Apr 20, 2026
8ce5393
[BOT] post-merge updates
OCA-git-bot Apr 20, 2026
ac45169
Added translation using Weblate (Galician)
chavaone Apr 23, 2026
0b9bab6
Translated using Weblate (Galician)
chavaone Apr 23, 2026
ab36a96
Translated using Weblate (Galician)
chavaone Apr 23, 2026
0c2154c
Translated using Weblate (Galician)
chavaone Apr 23, 2026
838db32
Translated using Weblate (Spanish)
Ed-Spain May 7, 2026
2453f76
Added translation using Weblate (Portuguese (Brazil))
rodmad85 May 19, 2026
9f06cd2
Translated using Weblate (Portuguese (Brazil))
rodmad85 May 19, 2026
386508c
Translated using Weblate (Galician)
chavaone May 21, 2026
531af7c
Translated using Weblate (Galician)
chavaone May 29, 2026
8251608
Translated using Weblate (Galician)
chavaone May 29, 2026
5f8e9d7
[IMP] mail_gateway_whatsapp: Update partner mobile when merging guest…
marcelsavegnago Oct 31, 2025
52c8cd0
[UPD] Update mail_gateway_whatsapp.pot
Jun 24, 2026
27fa40d
[BOT] post-merge updates
OCA-git-bot Jun 24, 2026
7a83c47
Update translation files
weblate Jun 24, 2026
956ef2a
Translated using Weblate (Italian)
mymage Jun 30, 2026
7386cf0
[MIG] mail_gateway_whatsapp: Migration to 19.0
DucTruongKomit Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions mail_gateway/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============
Mail Gateway
============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:cb4024a4b6e00026f5449ed8a293301f1d8b4935a36aad11139631d03e419c3d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
:target: https://github.com/OCA/mail/tree/19.0/mail_gateway
:alt: OCA/mail
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_gateway
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module will allow you to integrate an external chat system in your
Odoo system. It requires extra modules with the specific configuration
of each chat system, like mail_gateway_telegram or
mail_gateway_whatsapp.

This way, a group of users can respond customers or any other set of
partners within Odoo, but the messages will be sent through the external
chat system.

**Table of contents**

.. contents::
:local:

Usage
=====

When external messages are received, they will be directly sent to the
discuss menu. Answering to these messages will send the answer to the
external contact. We can assign this messages to any record using the
message actions. Also, we can assign the sender to a partner using the
followers menu and selecting the partner.

On a standard record associated to a partner with external chat, we can
send messages to the external contact directly selecting the methods of
the partner. To use this, we just need to use the

It is recomended to enable chatter notification to all users that will
receive messages from gateways.

Known issues / Roadmap
======================

1. Make possible to schedule gateway messages.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_gateway%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Creu Blanca
* Dixmit

Contributors
------------

- Enric Tobella

- Olga Marco

- `Tecnativa <https://tecnativa.com>`__

- Carlos Roca
- Eduardo Ezerouali

Other credits
-------------

This work has been funded by AEOdoo (Asociación Española de Odoo -
https://www.aeodoo.org)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/19.0/mail_gateway>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 6 additions & 0 deletions mail_gateway/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import controllers
from . import models
from . import tools

from .hooks import pre_init_hook
from . import wizards
33 changes: 33 additions & 0 deletions mail_gateway/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 Dixmit
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Mail Gateway",
"summary": "Base module for gateway communications",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Dixmit,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/mail",
"depends": ["mail"],
"pre_init_hook": "pre_init_hook",
"data": [
"wizards/mail_compose_gateway_message.xml",
"wizards/mail_message_gateway_link.xml",
"wizards/mail_message_gateway_send.xml",
"wizards/mail_guest_manage.xml",
"security/security.xml",
"security/ir.model.access.csv",
"views/mail_gateway.xml",
"views/res_partner_gateway_channel.xml",
"views/mail_guest_views.xml",
"views/res_users_settings_views.xml",
"views/mail_notification_views.xml",
],
"assets": {
"web.assets_backend": [
"mail_gateway/static/src/components/**/*",
"mail_gateway/static/src/core/**/*",
"mail_gateway/static/src/models/**/*",
],
},
}
1 change: 1 addition & 0 deletions mail_gateway/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import gateway
88 changes: 88 additions & 0 deletions mail_gateway/controllers/gateway.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Copyright 2024 Dixmit
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import json
import logging

from odoo.http import Controller, request, route

from odoo.addons.mail.tools.discuss import add_guest_to_context

_logger = logging.getLogger(__name__)


class GatewayController(Controller):
@route(
"/gateway/<string:usage>/<string:token>/update",
type="http",
auth="public",
methods=["GET", "POST"],
csrf=False,
)
@add_guest_to_context
def post_update(self, usage, token, *args, **kwargs):
if request.httprequest.method == "GET":
bot_data = request.env["mail.gateway"]._get_gateway(
token, gateway_type=usage, state="pending"
)
if not bot_data:
return request.make_response(
json.dumps({}),
[
("Content-Type", "application/json"),
],
)
return (
request.env[f"mail.gateway.{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(
token, gateway_type=usage, state="integrated"
)
if not bot_data:
_logger.warning(
"Gateway was not found for token %s with usage %s", token, usage
)
return request.make_response(
json.dumps({}),
[
("Content-Type", "application/json"),
],
)
charset = (
hasattr(request.httprequest, "charset")
and request.httprequest.charset
or "utf-8"
)
jsonrequest = json.loads(request.httprequest.get_data().decode(charset))
dispatcher = (
request.env[f"mail.gateway.{usage}"]
.with_user(bot_data["webhook_user_id"])
.with_context(no_gateway_notification=True)
)
if not dispatcher._verify_update(bot_data, jsonrequest):
_logger.warning(
"Message could not be verified for token %s with usage %s", token, usage
)
return request.make_response(
json.dumps({}),
[
("Content-Type", "application/json"),
],
)
_logger.debug(
"Received message for token %s with usage %s: %s",
token,
usage,
json.dumps(jsonrequest),
)
gateway = dispatcher.env["mail.gateway"].browse(bot_data["id"])
dispatcher._receive_update(gateway, jsonrequest)
return request.make_response(
json.dumps({}),
[
("Content-Type", "application/json"),
],
)
12 changes: 12 additions & 0 deletions mail_gateway/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def pre_init_hook(env):
"""
The objective of this hook is to speed up the installation
of the module on an existing Odoo instance.

Without this script, big databases can take a long time to install this
module.
"""
env.cr.execute(
"""ALTER TABLE mail_message
ADD COLUMN IF NOT EXISTS gateway_channel_id int"""
)
Loading
Loading