odoo-addon-mail-gateway 16.0.1.0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of odoo-addon-mail-gateway might be problematic. Click here for more details.

Files changed (73) hide show
  1. odoo/addons/mail_gateway/README.rst +100 -0
  2. odoo/addons/mail_gateway/__init__.py +6 -0
  3. odoo/addons/mail_gateway/__manifest__.py +38 -0
  4. odoo/addons/mail_gateway/controllers/__init__.py +2 -0
  5. odoo/addons/mail_gateway/controllers/discuss.py +11 -0
  6. odoo/addons/mail_gateway/controllers/gateway.py +81 -0
  7. odoo/addons/mail_gateway/hooks.py +12 -0
  8. odoo/addons/mail_gateway/i18n/mail_gateway.pot +533 -0
  9. odoo/addons/mail_gateway/models/__init__.py +10 -0
  10. odoo/addons/mail_gateway/models/ir_websocket.py +21 -0
  11. odoo/addons/mail_gateway/models/mail_channel.py +79 -0
  12. odoo/addons/mail_gateway/models/mail_gateway.py +149 -0
  13. odoo/addons/mail_gateway/models/mail_gateway_abstract.py +82 -0
  14. odoo/addons/mail_gateway/models/mail_guest.py +18 -0
  15. odoo/addons/mail_gateway/models/mail_message.py +123 -0
  16. odoo/addons/mail_gateway/models/mail_notification.py +43 -0
  17. odoo/addons/mail_gateway/models/mail_thread.py +85 -0
  18. odoo/addons/mail_gateway/models/res_partner.py +89 -0
  19. odoo/addons/mail_gateway/models/res_users.py +16 -0
  20. odoo/addons/mail_gateway/readme/CONFIGURATION.rst +4 -0
  21. odoo/addons/mail_gateway/readme/CONTRIBUTORS.rst +2 -0
  22. odoo/addons/mail_gateway/readme/CREDITS.rst +1 -0
  23. odoo/addons/mail_gateway/readme/DESCRIPTION.rst +5 -0
  24. odoo/addons/mail_gateway/readme/USAGE.rst +9 -0
  25. odoo/addons/mail_gateway/security/ir.model.access.csv +9 -0
  26. odoo/addons/mail_gateway/security/security.xml +61 -0
  27. odoo/addons/mail_gateway/static/description/icon.png +0 -0
  28. odoo/addons/mail_gateway/static/description/index.html +441 -0
  29. odoo/addons/mail_gateway/static/src/components/chatter/chatter.xml +40 -0
  30. odoo/addons/mail_gateway/static/src/components/composer/composer.xml +24 -0
  31. odoo/addons/mail_gateway/static/src/components/discuss_sidebar/discuss_sidebar.xml +17 -0
  32. odoo/addons/mail_gateway/static/src/components/gateway_follower/gateway_follower.esm.js +31 -0
  33. odoo/addons/mail_gateway/static/src/components/gateway_follower/gateway_follower.scss +12 -0
  34. odoo/addons/mail_gateway/static/src/components/gateway_follower/gateway_follower.xml +30 -0
  35. odoo/addons/mail_gateway/static/src/components/message/message.xml +22 -0
  36. odoo/addons/mail_gateway/static/src/components/message_notification_popover_content/message_notification_popover_content.xml +15 -0
  37. odoo/addons/mail_gateway/static/src/models/channel.esm.js +33 -0
  38. odoo/addons/mail_gateway/static/src/models/channel_member_view.esm.js +39 -0
  39. odoo/addons/mail_gateway/static/src/models/chatter.esm.js +41 -0
  40. odoo/addons/mail_gateway/static/src/models/composer.esm.js +32 -0
  41. odoo/addons/mail_gateway/static/src/models/composer_gateway_follower.esm.js +32 -0
  42. odoo/addons/mail_gateway/static/src/models/composer_view.esm.js +56 -0
  43. odoo/addons/mail_gateway/static/src/models/discuss.esm.js +51 -0
  44. odoo/addons/mail_gateway/static/src/models/discuss_sidebar_category.esm.js +128 -0
  45. odoo/addons/mail_gateway/static/src/models/discuss_sidebar_category_item.esm.js +51 -0
  46. odoo/addons/mail_gateway/static/src/models/gateway.esm.js +16 -0
  47. odoo/addons/mail_gateway/static/src/models/gateway_channel.esm.js +14 -0
  48. odoo/addons/mail_gateway/static/src/models/gateway_channel_view.esm.js +15 -0
  49. odoo/addons/mail_gateway/static/src/models/guest.esm.js +10 -0
  50. odoo/addons/mail_gateway/static/src/models/message.esm.js +76 -0
  51. odoo/addons/mail_gateway/static/src/models/message_action.esm.js +45 -0
  52. odoo/addons/mail_gateway/static/src/models/message_action_list.esm.js +37 -0
  53. odoo/addons/mail_gateway/static/src/models/message_action_view.esm.js +91 -0
  54. odoo/addons/mail_gateway/static/src/models/message_view.esm.js +13 -0
  55. odoo/addons/mail_gateway/static/src/models/messaging_initializer.esm.js +24 -0
  56. odoo/addons/mail_gateway/static/src/models/notification.esm.js +20 -0
  57. odoo/addons/mail_gateway/static/src/models/partner.esm.js +11 -0
  58. odoo/addons/mail_gateway/static/src/models/thread.esm.js +77 -0
  59. odoo/addons/mail_gateway/tests/__init__.py +0 -0
  60. odoo/addons/mail_gateway/tests/common.py +21 -0
  61. odoo/addons/mail_gateway/views/mail_gateway.xml +93 -0
  62. odoo/addons/mail_gateway/views/res_partner_gateway_channel.xml +59 -0
  63. odoo/addons/mail_gateway/wizards/__init__.py +3 -0
  64. odoo/addons/mail_gateway/wizards/mail_guest_manage.py +58 -0
  65. odoo/addons/mail_gateway/wizards/mail_guest_manage.xml +37 -0
  66. odoo/addons/mail_gateway/wizards/mail_message_gateway_link.py +42 -0
  67. odoo/addons/mail_gateway/wizards/mail_message_gateway_link.xml +28 -0
  68. odoo/addons/mail_gateway/wizards/mail_message_gateway_send.py +20 -0
  69. odoo/addons/mail_gateway/wizards/mail_message_gateway_send.xml +39 -0
  70. odoo_addon_mail_gateway-16.0.1.0.0.2.dist-info/METADATA +118 -0
  71. odoo_addon_mail_gateway-16.0.1.0.0.2.dist-info/RECORD +73 -0
  72. odoo_addon_mail_gateway-16.0.1.0.0.2.dist-info/WHEEL +5 -0
  73. odoo_addon_mail_gateway-16.0.1.0.0.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,100 @@
1
+ ============
2
+ Mail Gateway
3
+ ============
4
+
5
+ ..
6
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
+ !! This file is generated by oca-gen-addon-readme !!
8
+ !! changes will be overwritten. !!
9
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ !! source digest: sha256:1fc341f96ecbd2a96d20eb12aae392827aa821f05dbda6cc30a702d19a58f223
11
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+
13
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14
+ :target: https://odoo-community.org/page/development-status
15
+ :alt: Beta
16
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
+ :alt: License: AGPL-3
19
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
20
+ :target: https://github.com/OCA/social/tree/16.0/mail_gateway
21
+ :alt: OCA/social
22
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
+ :target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_gateway
24
+ :alt: Translate me on Weblate
25
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=16.0
27
+ :alt: Try me on Runboat
28
+
29
+ |badge1| |badge2| |badge3| |badge4| |badge5|
30
+
31
+ This module will allow you to integrate an external chat system in your Odoo system.
32
+ It requires extra modules with the specific configuration of each chat system, like `mail_gateway_telegram` or `mail_gateway_whatsapp`.
33
+
34
+ This way, a group of users can respond customers or any other set
35
+ of partners within Odoo, but the messages will be sent through the external chat system.
36
+
37
+ **Table of contents**
38
+
39
+ .. contents::
40
+ :local:
41
+
42
+ Usage
43
+ =====
44
+
45
+ When external messages are received, they will be directly sent to the discuss menu.
46
+ Answering to these messages will send the answer to the external contact.
47
+ We can assign this messages to any record using the message actions.
48
+ Also, we can assign the sender to a partner using the followers menu and selecting the partner.
49
+
50
+ 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.
51
+ To use this, we just need to use the
52
+
53
+ It is recomended to enable chatter notification to all users that will receive messages from gateways.
54
+
55
+ Bug Tracker
56
+ ===========
57
+
58
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
59
+ In case of trouble, please check there if your issue has already been reported.
60
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
61
+ `feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_gateway%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
62
+
63
+ Do not contact contributors directly about support or help with technical issues.
64
+
65
+ Credits
66
+ =======
67
+
68
+ Authors
69
+ ~~~~~~~
70
+
71
+ * Creu Blanca
72
+ * Dixmit
73
+
74
+ Contributors
75
+ ~~~~~~~~~~~~
76
+
77
+ * Enric Tobella
78
+ * Olga Marco
79
+
80
+ Other credits
81
+ ~~~~~~~~~~~~~
82
+
83
+ This work has been funded by AEOdoo (Asociación Española de Odoo - https://www.aeodoo.org)
84
+
85
+ Maintainers
86
+ ~~~~~~~~~~~
87
+
88
+ This module is maintained by the OCA.
89
+
90
+ .. image:: https://odoo-community.org/logo.png
91
+ :alt: Odoo Community Association
92
+ :target: https://odoo-community.org
93
+
94
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
95
+ mission is to support the collaborative development of Odoo features and
96
+ promote its widespread use.
97
+
98
+ This module is part of the `OCA/social <https://github.com/OCA/social/tree/16.0/mail_gateway>`_ project on GitHub.
99
+
100
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1,6 @@
1
+ from . import controllers
2
+ from . import models
3
+
4
+ # from . import services
5
+ from .hooks import pre_init_hook
6
+ from . import wizards
@@ -0,0 +1,38 @@
1
+ # Copyright 2024 Dixmit
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
+
4
+ {
5
+ "name": "Mail Gateway",
6
+ "summary": """
7
+ Set a gateway""",
8
+ "version": "16.0.1.0.0",
9
+ "license": "AGPL-3",
10
+ "author": "Creu Blanca,Dixmit,Odoo Community Association (OCA)",
11
+ "website": "https://github.com/OCA/social",
12
+ "depends": ["mail"],
13
+ "pre_init_hook": "pre_init_hook",
14
+ "data": [
15
+ "wizards/mail_message_gateway_link.xml",
16
+ "wizards/mail_message_gateway_send.xml",
17
+ "wizards/mail_guest_manage.xml",
18
+ "security/security.xml",
19
+ "security/ir.model.access.csv",
20
+ "views/mail_gateway.xml",
21
+ "views/res_partner_gateway_channel.xml",
22
+ ],
23
+ "assets": {
24
+ "mail.assets_messaging": [
25
+ "mail_gateway/static/src/models/**/*.js",
26
+ ],
27
+ "web.assets_backend": [
28
+ "mail_gateway/static/src/components/**/*.xml",
29
+ "mail_gateway/static/src/components/**/*.js",
30
+ "mail_gateway/static/src/components/**/*.scss",
31
+ ],
32
+ "mail.assets_discuss_public": [
33
+ "mail_gateway/static/src/components/**/*.xml",
34
+ "mail_gateway/static/src/components/**/*.js",
35
+ "mail_gateway/static/src/components/**/*.scss",
36
+ ],
37
+ },
38
+ }
@@ -0,0 +1,2 @@
1
+ from . import gateway
2
+ from . import discuss
@@ -0,0 +1,11 @@
1
+ # Copyright 2024 Dixmit
2
+ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3
+
4
+ from odoo.addons.mail.controllers.discuss import DiscussController
5
+
6
+
7
+ class GatewayDiscussController(DiscussController):
8
+ def _get_allowed_message_post_params(self):
9
+ result = super()._get_allowed_message_post_params()
10
+ result.add("gateway_notifications")
11
+ return result
@@ -0,0 +1,81 @@
1
+ # Copyright 2024 Dixmit
2
+ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3
+
4
+ import json
5
+ import logging
6
+
7
+ from odoo.http import Controller, request, route
8
+
9
+ _logger = logging.getLogger(__name__)
10
+
11
+
12
+ class GatewayController(Controller):
13
+ @route(
14
+ "/gateway/<string:usage>/<string:token>/update",
15
+ type="http",
16
+ auth="public",
17
+ methods=["GET", "POST"],
18
+ csrf=False,
19
+ )
20
+ def post_update(self, usage, token, *args, **kwargs):
21
+ if request.httprequest.method == "GET":
22
+ bot_data = request.env["mail.gateway"]._get_gateway(
23
+ token, gateway_type=usage, state="pending"
24
+ )
25
+ if not bot_data:
26
+ return request.make_response(
27
+ json.dumps({}),
28
+ [
29
+ ("Content-Type", "application/json"),
30
+ ],
31
+ )
32
+ return (
33
+ request.env["mail.gateway.%s" % usage]
34
+ .with_user(bot_data["webhook_user_id"])
35
+ ._receive_get_update(bot_data, request, **kwargs)
36
+ )
37
+ bot_data = request.env["mail.gateway"]._get_gateway(
38
+ token, gateway_type=usage, state="integrated"
39
+ )
40
+ if not bot_data:
41
+ _logger.warning(
42
+ "Gateway was not found for token %s with usage %s", token, usage
43
+ )
44
+ return request.make_response(
45
+ json.dumps({}),
46
+ [
47
+ ("Content-Type", "application/json"),
48
+ ],
49
+ )
50
+ jsonrequest = json.loads(
51
+ request.httprequest.get_data().decode(request.httprequest.charset)
52
+ )
53
+ dispatcher = (
54
+ request.env["mail.gateway.%s" % usage]
55
+ .with_user(bot_data["webhook_user_id"])
56
+ .with_context(no_gateway_notification=True)
57
+ )
58
+ if not dispatcher._verify_update(bot_data, jsonrequest):
59
+ _logger.warning(
60
+ "Message could not be verified for token %s with usage %s", token, usage
61
+ )
62
+ return request.make_response(
63
+ json.dumps({}),
64
+ [
65
+ ("Content-Type", "application/json"),
66
+ ],
67
+ )
68
+ _logger.debug(
69
+ "Received message for token %s with usage %s: %s",
70
+ token,
71
+ usage,
72
+ json.dumps(jsonrequest),
73
+ )
74
+ gateway = dispatcher.env["mail.gateway"].browse(bot_data["id"])
75
+ dispatcher._receive_update(gateway, jsonrequest)
76
+ return request.make_response(
77
+ json.dumps({}),
78
+ [
79
+ ("Content-Type", "application/json"),
80
+ ],
81
+ )
@@ -0,0 +1,12 @@
1
+ def pre_init_hook(cr):
2
+ """
3
+ The objective of this hook is to speed up the installation
4
+ of the module on an existing Odoo instance.
5
+
6
+ Without this script, big databases can take a long time to install this
7
+ module.
8
+ """
9
+ cr.execute(
10
+ """ALTER TABLE mail_message
11
+ ADD COLUMN gateway_channel_id int"""
12
+ )