odoo-addon-mail-gateway-whatsapp 16.0.1.1.0.6__py3-none-any.whl → 17.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.
Files changed (42) hide show
  1. odoo/addons/mail_gateway_whatsapp/README.rst +61 -45
  2. odoo/addons/mail_gateway_whatsapp/__manifest__.py +2 -6
  3. odoo/addons/mail_gateway_whatsapp/i18n/es.po +0 -10
  4. odoo/addons/mail_gateway_whatsapp/i18n/it.po +3 -13
  5. odoo/addons/mail_gateway_whatsapp/i18n/mail_gateway_whatsapp.pot +2 -23
  6. odoo/addons/mail_gateway_whatsapp/models/__init__.py +1 -1
  7. odoo/addons/mail_gateway_whatsapp/models/{mail_channel.py → discuss_channel.py} +5 -8
  8. odoo/addons/mail_gateway_whatsapp/models/mail_gateway_whatsapp.py +21 -33
  9. odoo/addons/mail_gateway_whatsapp/models/mail_thread.py +3 -7
  10. odoo/addons/mail_gateway_whatsapp/readme/CONFIGURE.md +35 -0
  11. odoo/addons/mail_gateway_whatsapp/readme/CONTRIBUTORS.md +7 -0
  12. odoo/addons/mail_gateway_whatsapp/readme/{CREDITS.rst → CREDITS.md} +2 -1
  13. odoo/addons/mail_gateway_whatsapp/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -2
  14. odoo/addons/mail_gateway_whatsapp/readme/ROADMAP.md +4 -0
  15. odoo/addons/mail_gateway_whatsapp/readme/USAGE.md +3 -0
  16. odoo/addons/mail_gateway_whatsapp/static/description/index.html +55 -40
  17. odoo/addons/mail_gateway_whatsapp/static/src/components/message/message.xml +2 -2
  18. odoo/addons/mail_gateway_whatsapp/static/src/components/message/message_patch.esm.js +17 -0
  19. odoo/addons/mail_gateway_whatsapp/static/src/components/phone_field/phone_field.esm.js +1 -1
  20. odoo/addons/mail_gateway_whatsapp/static/src/components/phone_field/phone_field.xml +2 -2
  21. odoo/addons/mail_gateway_whatsapp/static/src/components/send_whatsapp_button/send_whatsapp_button.esm.js +3 -3
  22. odoo/addons/mail_gateway_whatsapp/tests/test_mail_gateway_whatsapp.py +10 -8
  23. odoo/addons/mail_gateway_whatsapp/tools/const.py +1 -1
  24. odoo/addons/mail_gateway_whatsapp/views/mail_gateway.xml +7 -10
  25. odoo/addons/mail_gateway_whatsapp/views/mail_whatsapp_template_views.xml +11 -26
  26. odoo/addons/mail_gateway_whatsapp/wizards/mail_compose_gateway_message.py +1 -3
  27. odoo/addons/mail_gateway_whatsapp/wizards/mail_compose_gateway_message.xml +2 -6
  28. odoo/addons/mail_gateway_whatsapp/wizards/whatsapp_composer.py +1 -2
  29. odoo/addons/mail_gateway_whatsapp/wizards/whatsapp_composer.xml +4 -11
  30. {odoo_addon_mail_gateway_whatsapp-16.0.1.1.0.6.dist-info → odoo_addon_mail_gateway_whatsapp-17.0.1.0.0.2.dist-info}/METADATA +69 -52
  31. odoo_addon_mail_gateway_whatsapp-17.0.1.0.0.2.dist-info/RECORD +46 -0
  32. {odoo_addon_mail_gateway_whatsapp-16.0.1.1.0.6.dist-info → odoo_addon_mail_gateway_whatsapp-17.0.1.0.0.2.dist-info}/WHEEL +1 -1
  33. odoo_addon_mail_gateway_whatsapp-17.0.1.0.0.2.dist-info/top_level.txt +1 -0
  34. odoo/addons/mail_gateway_whatsapp/readme/CONFIGURE.rst +0 -31
  35. odoo/addons/mail_gateway_whatsapp/readme/CONTRIBUTORS.rst +0 -5
  36. odoo/addons/mail_gateway_whatsapp/readme/ROADMAP.rst +0 -4
  37. odoo/addons/mail_gateway_whatsapp/readme/USAGE.rst +0 -3
  38. odoo/addons/mail_gateway_whatsapp/static/src/models/message.esm.js +0 -21
  39. odoo/addons/mail_gateway_whatsapp/static/src/models/message_view.esm.js +0 -25
  40. odoo/addons/mail_gateway_whatsapp/static/src/models/notification.esm.js +0 -25
  41. odoo_addon_mail_gateway_whatsapp-16.0.1.1.0.6.dist-info/RECORD +0 -48
  42. odoo_addon_mail_gateway_whatsapp-16.0.1.1.0.6.dist-info/top_level.txt +0 -1
@@ -1,3 +1,7 @@
1
+ .. image:: https://odoo-community.org/readme-banner-image
2
+ :target: https://odoo-community.org/get-involved?utm_source=readme
3
+ :alt: Odoo Community Association
4
+
1
5
  =====================
2
6
  Mail Whatsapp Gateway
3
7
  =====================
@@ -7,31 +11,31 @@ Mail Whatsapp Gateway
7
11
  !! This file is generated by oca-gen-addon-readme !!
8
12
  !! changes will be overwritten. !!
9
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:70475641a2c7498a1ee67811eadb397e33c33435cdd2efb8edce729026ad09c4
14
+ !! source digest: sha256:abc9cf8f5146c06cb1a2171d01ee1797a2f5a092bc0dd29c5e39106dadc14efd
11
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
16
 
13
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14
18
  :target: https://odoo-community.org/page/development-status
15
19
  :alt: Beta
16
- .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20
+ .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
17
21
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
22
  :alt: License: AGPL-3
19
23
  .. |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_whatsapp
24
+ :target: https://github.com/OCA/social/tree/17.0/mail_gateway_whatsapp
21
25
  :alt: OCA/social
22
26
  .. |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_whatsapp
27
+ :target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_gateway_whatsapp
24
28
  :alt: Translate me on Weblate
25
29
  .. |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
30
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=17.0
27
31
  :alt: Try me on Runboat
28
32
 
29
33
  |badge1| |badge2| |badge3| |badge4| |badge5|
30
34
 
31
35
  This module allows to respond whatsapp chats.
32
36
 
33
- This way, a group of users can respond customers or any other set
34
- of partners in an integrated way.
37
+ This way, a group of users can respond customers or any other set of
38
+ partners in an integrated way.
35
39
 
36
40
  **Table of contents**
37
41
 
@@ -42,41 +46,50 @@ Configuration
42
46
  =============
43
47
 
44
48
  First steps
45
- ~~~~~~~~~~~
49
+ -----------
46
50
 
47
- You need to create a WhatsApp Business Account (WABA), a Meta App and define a phone number.
48
- You can follow this `steps <https://developers.facebook.com/micro_site/url/?click_from_context_menu=true&country=ES&destination=https%3A%2F%2Fwww.facebook.com%2Fbusiness%2Fhelp%2F2087193751603668&event_type=click&last_nav_impression_id=0m3TRxrxOlly1eRmB&max_percent_page_viewed=22&max_viewport_height_px=1326&max_viewport_width_px=2560&orig_http_referrer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fwhatsapp%2Fcloud-api%2Fget-started-for-bsps%3Flocale%3Den_US&orig_request_uri=https%3A%2F%2Fdevelopers.facebook.com%2Fajax%2Fpagelet%2Fgeneric.php%2FDeveloperNotificationsPayloadPagelet%3Ffb_dtsg_ag%3D--sanitized--%26data%3D%257B%2522businessUserID%2522%253Anull%252C%2522cursor%2522%253Anull%252C%2522length%2522%253A15%252C%2522clientRequestID%2522%253A%2522js_k6%2522%257D%26__usid%3D6-Trd7hi4itpm%253APrd7ifiub2tvy%253A0-Ard7g9twdm0p1-RV%253D6%253AF%253D%26locale%3Den_US%26jazoest%3D24920&region=emea&scrolled=false&session_id=1jLoVJNU6iVMaw3ml&site=developers>`_.
51
+ You need to create a WhatsApp Business Account (WABA), a Meta App and
52
+ define a phone number. You can follow this
53
+ `steps <https://developers.facebook.com/micro_site/url/?click_from_context_menu=true&country=ES&destination=https%3A%2F%2Fwww.facebook.com%2Fbusiness%2Fhelp%2F2087193751603668&event_type=click&last_nav_impression_id=0m3TRxrxOlly1eRmB&max_percent_page_viewed=22&max_viewport_height_px=1326&max_viewport_width_px=2560&orig_http_referrer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fwhatsapp%2Fcloud-api%2Fget-started-for-bsps%3Flocale%3Den_US&orig_request_uri=https%3A%2F%2Fdevelopers.facebook.com%2Fajax%2Fpagelet%2Fgeneric.php%2FDeveloperNotificationsPayloadPagelet%3Ffb_dtsg_ag%3D--sanitized--%26data%3D%257B%2522businessUserID%2522%253Anull%252C%2522cursor%2522%253Anull%252C%2522length%2522%253A15%252C%2522clientRequestID%2522%253A%2522js_k6%2522%257D%26__usid%3D6-Trd7hi4itpm%253APrd7ifiub2tvy%253A0-Ard7g9twdm0p1-RV%253D6%253AF%253D%26locale%3Den_US%26jazoest%3D24920&region=emea&scrolled=false&session_id=1jLoVJNU6iVMaw3ml&site=developers>`__.
49
54
 
50
- If you create a test Business Account, passwords will change every 24 hours.
55
+ If you create a test Business Account, passwords will change every 24
56
+ hours.
51
57
 
52
58
  In order to make the webhook accessible, the system must be public.
53
59
 
54
60
  Configure the gateway
55
- ~~~~~~~~~~~~~~~~~~~~~
56
-
57
- Once you have created the Meta App, you need to add the gateway and webhook.
58
- In order to make it you must follow this steps:
59
-
60
- * Access `Settings > Emails > Mail Gateway`
61
- * Create a Gateway of type `WhatsApp`
62
-
63
- * Use the Meta App authentication key as `Token` field
64
- * Use the Meta App Phone Number ID as `Whatsapp from Phone` field
65
- * Use the Meta Account Business ID as `Whatsapp account` field (only if you need sync templates)
66
- * Write your own `Webhook key`
67
- * Use the Application Secret Key on `Whatsapp Security Key`. It will be used in order to validate the data
68
- * Press the `Integrate Webhook Key`. In this case, it will not integrate it, we need to make it manually
69
- * Copy the webhook URL
70
-
71
- * Access `Facebook Apps website <https://developers.facebook.com/apps/>`_
72
- * Access your App then `Whatsapp > Configuration`
73
- * Create your webhook using your URL and put the Whatsapp Security Key as validation Key
74
- * Administer the Webhook and activate the messages webhook
61
+ ---------------------
62
+
63
+ Once you have created the Meta App, you need to add the gateway and
64
+ webhook. In order to make it you must follow this steps:
65
+
66
+ - Access Settings > Emails > Mail Gateway
67
+ - Create a Gateway of type WhatsApp
68
+
69
+ ..
70
+
71
+ - Use the Meta App authentication key as Token field
72
+ - Use the Meta App Phone Number ID as Whatsapp from Phone field
73
+ - Use the Meta Account Business ID as Whatsapp account field (only if
74
+ you need sync templates)
75
+ - Write your own Webhook key
76
+ - Use the Application Secret Key on Whatsapp Security Key. It will be
77
+ used in order to validate the data
78
+ - Press the Integrate Webhook Key. In this case, it will not
79
+ integrate it, we need to make it manually
80
+ - Copy the webhook URL
81
+
82
+ - Access `Facebook Apps
83
+ website <https://developers.facebook.com/apps/>`__
84
+ - Access your App then Whatsapp > Configuration
85
+ - Create your webhook using your URL and put the Whatsapp Security Key
86
+ as validation Key
87
+ - Administer the Webhook and activate the messages webhook
75
88
 
76
89
  Usage
77
90
  =====
78
91
 
79
- 1. Access `Gateway`
92
+ 1. Access Gateway
80
93
  2. Wait until someone starts a conversation.
81
94
  3. Now you will be able to respond and receive messages to this person.
82
95
 
@@ -85,8 +98,8 @@ Known issues / Roadmap
85
98
 
86
99
  **WhatsApp templates**
87
100
 
88
- * Add support for `Variables`
89
- * Add support for `Buttons`
101
+ - Add support for Variables
102
+ - Add support for Buttons
90
103
 
91
104
  Bug Tracker
92
105
  ===========
@@ -94,7 +107,7 @@ Bug Tracker
94
107
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
95
108
  In case of trouble, please check there if your issue has already been reported.
96
109
  If you spotted it first, help us to smash it by providing a detailed and welcomed
97
- `feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_gateway_whatsapp%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
110
+ `feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_gateway_whatsapp%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
98
111
 
99
112
  Do not contact contributors directly about support or help with technical issues.
100
113
 
@@ -102,27 +115,30 @@ Credits
102
115
  =======
103
116
 
104
117
  Authors
105
- ~~~~~~~
118
+ -------
106
119
 
107
120
  * Creu Blanca
108
121
  * Dixmit
109
122
 
110
123
  Contributors
111
- ~~~~~~~~~~~~
124
+ ------------
125
+
126
+ - Olga Marco <olga.marco@creublanca.es>
127
+
128
+ - Enric Tobella <etobella@creublanca.es>
112
129
 
113
- * Olga Marco <olga.marco@creublanca.es>
114
- * Enric Tobella <etobella@creublanca.es>
115
- * `Tecnativa <https://www.tecnativa.com>`_:
130
+ - `Tecnativa <https://www.tecnativa.com>`__:
116
131
 
117
- * Carlos Lopez
132
+ - Carlos Lopez
118
133
 
119
134
  Other credits
120
- ~~~~~~~~~~~~~
135
+ -------------
121
136
 
122
- This work has been funded by AEOdoo (Asociación Española de Odoo - https://www.aeodoo.org)
137
+ This work has been funded by AEOdoo (Asociación Española de Odoo -
138
+ https://www.aeodoo.org)
123
139
 
124
140
  Maintainers
125
- ~~~~~~~~~~~
141
+ -----------
126
142
 
127
143
  This module is maintained by the OCA.
128
144
 
@@ -134,6 +150,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
134
150
  mission is to support the collaborative development of Odoo features and
135
151
  promote its widespread use.
136
152
 
137
- This module is part of the `OCA/social <https://github.com/OCA/social/tree/16.0/mail_gateway_whatsapp>`_ project on GitHub.
153
+ This module is part of the `OCA/social <https://github.com/OCA/social/tree/17.0/mail_gateway_whatsapp>`_ project on GitHub.
138
154
 
139
155
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -5,7 +5,7 @@
5
5
  "name": "Mail Whatsapp Gateway",
6
6
  "summary": """
7
7
  Set a gateway for whatsapp""",
8
- "version": "16.0.1.1.0",
8
+ "version": "17.0.1.0.0",
9
9
  "license": "AGPL-3",
10
10
  "author": "Creu Blanca, Dixmit, Odoo Community Association (OCA)",
11
11
  "website": "https://github.com/OCA/social",
@@ -20,12 +20,8 @@
20
20
  "views/mail_gateway.xml",
21
21
  ],
22
22
  "assets": {
23
- "mail.assets_messaging": [
24
- "mail_gateway_whatsapp/static/src/models/**/*.js",
25
- ],
26
23
  "web.assets_backend": [
27
- "mail_gateway_whatsapp/static/src/components/**/*.xml",
28
- "mail_gateway_whatsapp/static/src/components/**/*.js",
24
+ "mail_gateway_whatsapp/static/src/components/**/*",
29
25
  ],
30
26
  },
31
27
  }
@@ -698,21 +698,11 @@ msgstr "Contenido del mensaje"
698
698
  msgid "Message Delivery error"
699
699
  msgstr "Error en la entrega del mensaje"
700
700
 
701
- #. module: mail_gateway_whatsapp
702
- #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_search
703
- msgid "Message Search"
704
- msgstr ""
705
-
706
701
  #. module: mail_gateway_whatsapp
707
702
  #: model:ir.model.fields,help:mail_gateway_whatsapp.field_res_partner__message_content
708
703
  msgid "Message content, to be used only in searches"
709
704
  msgstr "Contenido del mensaje, que sólo se utilizará en las búsquedas"
710
705
 
711
- #. module: mail_gateway_whatsapp
712
- #: model:ir.model.fields,help:mail_gateway_whatsapp.field_res_partner__message_search
713
- msgid "Message search, to be used only in searches"
714
- msgstr ""
715
-
716
706
  #. module: mail_gateway_whatsapp
717
707
  #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_ids
718
708
  msgid "Messages"
@@ -6,7 +6,7 @@ msgid ""
6
6
  msgstr ""
7
7
  "Project-Id-Version: Odoo Server 16.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
- "PO-Revision-Date: 2025-06-03 07:06+0000\n"
9
+ "PO-Revision-Date: 2025-01-09 13:06+0000\n"
10
10
  "Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11
11
  "Language-Team: none\n"
12
12
  "Language: it\n"
@@ -14,7 +14,7 @@ msgstr ""
14
14
  "Content-Type: text/plain; charset=UTF-8\n"
15
15
  "Content-Transfer-Encoding: \n"
16
16
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
- "X-Generator: Weblate 5.10.4\n"
17
+ "X-Generator: Weblate 5.6.2\n"
18
18
 
19
19
  #. module: mail_gateway_whatsapp
20
20
  #: model_terms:ir.ui.view,arch_db:mail_gateway_whatsapp.mail_gateway_form_view
@@ -111,7 +111,7 @@ msgstr "Azerbaigiano"
111
111
  #. module: mail_gateway_whatsapp
112
112
  #: model_terms:ir.ui.view,arch_db:mail_gateway_whatsapp.view_mail_whatsapp_template_form
113
113
  msgid "Back to draft"
114
- msgstr "Reimposta a bozza"
114
+ msgstr "Ritorna a bozza"
115
115
 
116
116
  #. module: mail_gateway_whatsapp
117
117
  #: model:ir.model.fields.selection,name:mail_gateway_whatsapp.selection__mail_whatsapp_template__language__bn
@@ -699,21 +699,11 @@ msgstr "Contenuto messaggio"
699
699
  msgid "Message Delivery error"
700
700
  msgstr "Errore di consegna messaggio"
701
701
 
702
- #. module: mail_gateway_whatsapp
703
- #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_search
704
- msgid "Message Search"
705
- msgstr "Ricerca messaggio"
706
-
707
702
  #. module: mail_gateway_whatsapp
708
703
  #: model:ir.model.fields,help:mail_gateway_whatsapp.field_res_partner__message_content
709
704
  msgid "Message content, to be used only in searches"
710
705
  msgstr "Contenuto messaggio, da utilizzare solo nelle ricerche"
711
706
 
712
- #. module: mail_gateway_whatsapp
713
- #: model:ir.model.fields,help:mail_gateway_whatsapp.field_res_partner__message_search
714
- msgid "Message search, to be used only in searches"
715
- msgstr "Ricerca messaggio, da utilizzare solo nelle ricerche"
716
-
717
707
  #. module: mail_gateway_whatsapp
718
708
  #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_ids
719
709
  msgid "Messages"
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 16.0\n"
7
+ "Project-Id-Version: Odoo Server 17.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -254,7 +254,7 @@ msgid "Disabled"
254
254
  msgstr ""
255
255
 
256
256
  #. module: mail_gateway_whatsapp
257
- #: model:ir.model,name:mail_gateway_whatsapp.model_mail_channel
257
+ #: model:ir.model,name:mail_gateway_whatsapp.model_discuss_channel
258
258
  msgid "Discussion Channel"
259
259
  msgstr ""
260
260
 
@@ -570,12 +570,6 @@ msgstr ""
570
570
  msgid "Lao"
571
571
  msgstr ""
572
572
 
573
- #. module: mail_gateway_whatsapp
574
- #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_mail_whatsapp_template____last_update
575
- #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_whatsapp_composer____last_update
576
- msgid "Last Modified on"
577
- msgstr ""
578
-
579
573
  #. module: mail_gateway_whatsapp
580
574
  #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_mail_whatsapp_template__write_uid
581
575
  #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_whatsapp_composer__write_uid
@@ -623,11 +617,6 @@ msgstr ""
623
617
  msgid "Mail WhatsApp template"
624
618
  msgstr ""
625
619
 
626
- #. module: mail_gateway_whatsapp
627
- #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_main_attachment_id
628
- msgid "Main Attachment"
629
- msgstr ""
630
-
631
620
  #. module: mail_gateway_whatsapp
632
621
  #: model:ir.model.fields.selection,name:mail_gateway_whatsapp.selection__mail_whatsapp_template__language__ms
633
622
  msgid "Malay"
@@ -663,21 +652,11 @@ msgstr ""
663
652
  msgid "Message Delivery error"
664
653
  msgstr ""
665
654
 
666
- #. module: mail_gateway_whatsapp
667
- #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_search
668
- msgid "Message Search"
669
- msgstr ""
670
-
671
655
  #. module: mail_gateway_whatsapp
672
656
  #: model:ir.model.fields,help:mail_gateway_whatsapp.field_res_partner__message_content
673
657
  msgid "Message content, to be used only in searches"
674
658
  msgstr ""
675
659
 
676
- #. module: mail_gateway_whatsapp
677
- #: model:ir.model.fields,help:mail_gateway_whatsapp.field_res_partner__message_search
678
- msgid "Message search, to be used only in searches"
679
- msgstr ""
680
-
681
660
  #. module: mail_gateway_whatsapp
682
661
  #: model:ir.model.fields,field_description:mail_gateway_whatsapp.field_res_partner__message_ids
683
662
  msgid "Messages"
@@ -1,6 +1,6 @@
1
1
  from . import mail_gateway
2
2
  from . import mail_thread
3
3
  from . import mail_gateway_whatsapp
4
- from . import mail_channel
4
+ from . import discuss_channel
5
5
  from . import res_partner
6
6
  from . import mail_whatsapp_template
@@ -2,21 +2,18 @@
2
2
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
3
 
4
4
  from odoo import models
5
- from odoo.modules.module import get_resource_path
5
+ from odoo.tools.misc import file_path
6
6
 
7
7
  from odoo.addons.base.models.avatar_mixin import get_hsl_from_seed
8
8
 
9
9
 
10
- class MailChannel(models.Model):
11
-
12
- _inherit = "mail.channel"
10
+ class DiscussChannel(models.Model):
11
+ _inherit = "discuss.channel"
13
12
 
14
13
  def _generate_avatar_gateway(self):
15
14
  if self.gateway_id.gateway_type == "whatsapp":
16
- path = get_resource_path(
17
- "mail_gateway_whatsapp", "static/description", "icon.svg"
18
- )
19
- with open(path, "r") as f:
15
+ path = file_path("mail_gateway_whatsapp/static/description/icon.svg")
16
+ with open(path) as f:
20
17
  avatar = f.read()
21
18
 
22
19
  bgcolor = get_hsl_from_seed(self.uuid)
@@ -88,13 +88,10 @@ class MailGatewayWhatsappService(models.AbstractModel):
88
88
  image_id = message.get(key).get("id")
89
89
  if image_id:
90
90
  image_info_request = requests.get(
91
- "https://graph.facebook.com/v%s/%s"
92
- % (
93
- chat.gateway_id.whatsapp_version,
94
- image_id,
95
- ),
91
+ f"https://graph.facebook.com/"
92
+ f"v{chat.gateway_id.whatsapp_version}/{image_id}",
96
93
  headers={
97
- "Authorization": "Bearer %s" % chat.gateway_id.token,
94
+ "Authorization": f"Bearer {chat.gateway_id.token}",
98
95
  },
99
96
  timeout=10,
100
97
  proxies=self._get_proxies(),
@@ -127,17 +124,19 @@ class MailGatewayWhatsappService(models.AbstractModel):
127
124
  if message.get("location"):
128
125
  body += (
129
126
  '<a target="_blank" href="https://www.google.com/'
130
- 'maps/search/?api=1&query=%s,%s">Location</a>'
131
- % (
132
- message["location"]["latitude"],
133
- message["location"]["longitude"],
134
- )
127
+ f'maps/search/?api=1&query={message["location"]["latitude"]},'
128
+ f'{message["location"]["longitude"]}">Location</a>'
135
129
  )
136
130
  if message.get("contacts"):
137
131
  pass
138
132
  if len(body) > 0 or attachments:
139
133
  author = self._get_author(chat.gateway_id, value)
140
- new_message = chat.message_post(
134
+ if author._name == "mail.guest":
135
+ chat = chat.with_user(self.env.ref("base.public_user").id).with_context(
136
+ guest=author
137
+ )
138
+ # TODO: Check the sudo...
139
+ new_message = chat.sudo().message_post(
141
140
  body=body,
142
141
  author_id=author and author._name == "res.partner" and author.id,
143
142
  gateway_type="whatsapp",
@@ -208,13 +207,10 @@ class MailGatewayWhatsappService(models.AbstractModel):
208
207
  )
209
208
 
210
209
  response = requests.post(
211
- "https://graph.facebook.com/v%s/%s/media"
212
- % (
213
- gateway.whatsapp_version,
214
- gateway.whatsapp_from_phone,
215
- ),
210
+ f"https://graph.facebook.com/"
211
+ f"v{gateway.whatsapp_version}/{gateway.whatsapp_from_phone}/media",
216
212
  headers={
217
- "Authorization": "Bearer %s" % gateway.token,
213
+ "Authorization": f"Bearer {gateway.token}",
218
214
  "content-type": m.content_type,
219
215
  },
220
216
  data=m,
@@ -223,12 +219,9 @@ class MailGatewayWhatsappService(models.AbstractModel):
223
219
  )
224
220
  response.raise_for_status()
225
221
  response = requests.post(
226
- "https://graph.facebook.com/v%s/%s/messages"
227
- % (
228
- gateway.whatsapp_version,
229
- gateway.whatsapp_from_phone,
230
- ),
231
- headers={"Authorization": "Bearer %s" % gateway.token},
222
+ f"https://graph.facebook.com/"
223
+ f"v{gateway.whatsapp_version}/{gateway.whatsapp_from_phone}/messages",
224
+ headers={"Authorization": f"Bearer {gateway.token}"},
232
225
  json=self._send_payload(
233
226
  record.gateway_channel_id,
234
227
  media_id=response.json()["id"],
@@ -243,12 +236,9 @@ class MailGatewayWhatsappService(models.AbstractModel):
243
236
  body = self._get_message_body(record)
244
237
  if body:
245
238
  response = requests.post(
246
- "https://graph.facebook.com/v%s/%s/messages"
247
- % (
248
- gateway.whatsapp_version,
249
- gateway.whatsapp_from_phone,
250
- ),
251
- headers={"Authorization": "Bearer %s" % gateway.token},
239
+ f"https://graph.facebook.com/"
240
+ f"v{gateway.whatsapp_version}/{gateway.whatsapp_from_phone}/messages",
241
+ headers={"Authorization": f"Bearer {gateway.token}"},
252
242
  json=self._send_payload(record.gateway_channel_id, body=body),
253
243
  timeout=10,
254
244
  proxies=self._get_proxies(),
@@ -264,9 +254,7 @@ class MailGatewayWhatsappService(models.AbstractModel):
264
254
  _("Unable to send the whatsapp message")
265
255
  ) from exc
266
256
  else:
267
- _logger.warning(
268
- "Issue sending message with id {}: {}".format(record.id, exc)
269
- )
257
+ _logger.warning(f"Issue sending message with id {record.id}: {exc}")
270
258
  record.sudo().write(
271
259
  {"notification_status": "exception", "failure_reason": exc}
272
260
  )
@@ -4,11 +4,8 @@
4
4
  from odoo import _, models
5
5
  from odoo.exceptions import UserError
6
6
 
7
- from odoo.addons.phone_validation.tools import phone_validation
8
-
9
7
 
10
8
  class MailThread(models.AbstractModel):
11
-
12
9
  _inherit = "mail.thread"
13
10
 
14
11
  def _get_whatsapp_channel_vals(self, token, gateway, partner):
@@ -22,12 +19,11 @@ class MailThread(models.AbstractModel):
22
19
  return result
23
20
 
24
21
  def _whatsapp_get_channel(self, field_name, gateway):
25
- phone = self[field_name]
26
- sanitize_res = phone_validation.phone_sanitize_numbers_w_record([phone], self)
27
- sanitized_number = sanitize_res[phone].get("sanitized")
22
+ sanitized_number = self._phone_format(number=self[field_name])
28
23
  if not sanitized_number:
29
24
  raise UserError(_("Phone cannot be sanitized"))
30
- sanitized_number = sanitized_number[1:]
25
+ # Avoid the plus sign prefix to match the whatsapp token
26
+ sanitized_number = sanitized_number.replace("+", "")
31
27
  partner = self._whatsapp_get_partner()
32
28
  if not self.env["res.partner.gateway.channel"].search(
33
29
  [
@@ -0,0 +1,35 @@
1
+ ## First steps
2
+
3
+ You need to create a WhatsApp Business Account (WABA), a Meta App and
4
+ define a phone number. You can follow this
5
+ [steps](https://developers.facebook.com/micro_site/url/?click_from_context_menu=true&country=ES&destination=https%3A%2F%2Fwww.facebook.com%2Fbusiness%2Fhelp%2F2087193751603668&event_type=click&last_nav_impression_id=0m3TRxrxOlly1eRmB&max_percent_page_viewed=22&max_viewport_height_px=1326&max_viewport_width_px=2560&orig_http_referrer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fwhatsapp%2Fcloud-api%2Fget-started-for-bsps%3Flocale%3Den_US&orig_request_uri=https%3A%2F%2Fdevelopers.facebook.com%2Fajax%2Fpagelet%2Fgeneric.php%2FDeveloperNotificationsPayloadPagelet%3Ffb_dtsg_ag%3D--sanitized--%26data%3D%257B%2522businessUserID%2522%253Anull%252C%2522cursor%2522%253Anull%252C%2522length%2522%253A15%252C%2522clientRequestID%2522%253A%2522js_k6%2522%257D%26__usid%3D6-Trd7hi4itpm%253APrd7ifiub2tvy%253A0-Ard7g9twdm0p1-RV%253D6%253AF%253D%26locale%3Den_US%26jazoest%3D24920&region=emea&scrolled=false&session_id=1jLoVJNU6iVMaw3ml&site=developers).
6
+
7
+ If you create a test Business Account, passwords will change every 24
8
+ hours.
9
+
10
+ In order to make the webhook accessible, the system must be public.
11
+
12
+ ## Configure the gateway
13
+
14
+ Once you have created the Meta App, you need to add the gateway and
15
+ webhook. In order to make it you must follow this steps:
16
+
17
+ - Access Settings \> Emails \> Mail Gateway
18
+ - Create a Gateway of type WhatsApp
19
+
20
+ > - Use the Meta App authentication key as Token field
21
+ > - Use the Meta App Phone Number ID as Whatsapp from Phone field
22
+ > - Use the Meta Account Business ID as Whatsapp account field (only if
23
+ > you need sync templates)
24
+ > - Write your own Webhook key
25
+ > - Use the Application Secret Key on Whatsapp Security Key. It will be
26
+ > used in order to validate the data
27
+ > - Press the Integrate Webhook Key. In this case, it will not integrate
28
+ > it, we need to make it manually
29
+ > - Copy the webhook URL
30
+
31
+ - Access [Facebook Apps website](https://developers.facebook.com/apps/)
32
+ - Access your App then Whatsapp \> Configuration
33
+ - Create your webhook using your URL and put the Whatsapp Security Key
34
+ as validation Key
35
+ - Administer the Webhook and activate the messages webhook
@@ -0,0 +1,7 @@
1
+ - Olga Marco \<<olga.marco@creublanca.es>\>
2
+
3
+ - Enric Tobella \<<etobella@creublanca.es>\>
4
+
5
+ - [Tecnativa](https://www.tecnativa.com):
6
+
7
+ > - Carlos Lopez
@@ -1 +1,2 @@
1
- This work has been funded by AEOdoo (Asociación Española de Odoo - https://www.aeodoo.org)
1
+ This work has been funded by AEOdoo (Asociación Española de Odoo -
2
+ <https://www.aeodoo.org>)
@@ -1,4 +1,4 @@
1
1
  This module allows to respond whatsapp chats.
2
2
 
3
- This way, a group of users can respond customers or any other set
4
- of partners in an integrated way.
3
+ This way, a group of users can respond customers or any other set of
4
+ partners in an integrated way.
@@ -0,0 +1,4 @@
1
+ **WhatsApp templates**
2
+
3
+ - Add support for Variables
4
+ - Add support for Buttons
@@ -0,0 +1,3 @@
1
+ 1. Access Gateway
2
+ 2. Wait until someone starts a conversation.
3
+ 3. Now you will be able to respond and receive messages to this person.