Skip to content

Commit 4850108

Browse files
committed
[MIG] mail_gateway: Migration to 17.0
TT50728
1 parent 67387f3 commit 4850108

File tree

74 files changed

+861
-2110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+861
-2110
lines changed

mail_gateway/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Mail Gateway
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:783756cf02490fad6813d177c717aaba666842b9a1e417ecad04fab2da04856d
10+
!! source digest: sha256:1fc341f96ecbd2a96d20eb12aae392827aa821f05dbda6cc30a702d19a58f223
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png

mail_gateway/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from . import controllers
22
from . import models
33

4-
# from . import services
54
from .hooks import pre_init_hook
65
from . import wizards

mail_gateway/__manifest__.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
{
55
"name": "Mail Gateway",
6-
"summary": """
7-
Set a gateway""",
8-
"version": "16.0.1.2.0",
6+
"summary": "Base module for gateway communications",
7+
"version": "17.0.1.0.0",
98
"license": "AGPL-3",
109
"author": "Creu Blanca,Dixmit,Odoo Community Association (OCA)",
1110
"website": "https://github.com/OCA/social",
@@ -20,20 +19,16 @@
2019
"security/ir.model.access.csv",
2120
"views/mail_gateway.xml",
2221
"views/res_partner_gateway_channel.xml",
22+
"views/mail_guest_views.xml",
2323
],
2424
"assets": {
25-
"mail.assets_messaging": [
26-
"mail_gateway/static/src/models/**/*.js",
27-
],
2825
"web.assets_backend": [
29-
"mail_gateway/static/src/components/**/*.xml",
30-
"mail_gateway/static/src/components/**/*.js",
31-
"mail_gateway/static/src/components/**/*.scss",
32-
],
33-
"mail.assets_discuss_public": [
34-
"mail_gateway/static/src/components/**/*.xml",
35-
"mail_gateway/static/src/components/**/*.js",
36-
"mail_gateway/static/src/components/**/*.scss",
26+
"mail_gateway/static/src/components/**/*",
27+
"mail_gateway/static/src/core/**/*",
28+
"mail_gateway/static/src/models/**/*",
3729
],
30+
# "mail.assets_public": [
31+
# "mail_gateway/static/src/components/**/*",
32+
# ],
3833
},
3934
}

mail_gateway/controllers/discuss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright 2024 Dixmit
22
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
33

4-
from odoo.addons.mail.controllers.discuss import DiscussController
4+
from odoo.addons.mail.controllers.thread import ThreadController
55

66

7-
class GatewayDiscussController(DiscussController):
7+
class GatewayThreadController(ThreadController):
88
def _get_allowed_message_post_params(self):
99
result = super()._get_allowed_message_post_params()
1010
result.add("gateway_notifications")

mail_gateway/controllers/gateway.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
from odoo.http import Controller, request, route
88

9+
from odoo.addons.mail.models.discuss.mail_guest import add_guest_to_context
10+
911
_logger = logging.getLogger(__name__)
1012

1113

@@ -17,6 +19,7 @@ class GatewayController(Controller):
1719
methods=["GET", "POST"],
1820
csrf=False,
1921
)
22+
@add_guest_to_context
2023
def post_update(self, usage, token, *args, **kwargs):
2124
if request.httprequest.method == "GET":
2225
bot_data = request.env["mail.gateway"]._get_gateway(

mail_gateway/hooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
def pre_init_hook(cr):
1+
def pre_init_hook(env):
22
"""
33
The objective of this hook is to speed up the installation
44
of the module on an existing Odoo instance.
55
66
Without this script, big databases can take a long time to install this
77
module.
88
"""
9-
cr.execute(
9+
env.cr.execute(
1010
"""ALTER TABLE mail_message
11-
ADD COLUMN gateway_channel_id int"""
11+
ADD COLUMN IF NOT EXISTS gateway_channel_id int"""
1212
)

0 commit comments

Comments
 (0)