odoo-addon-mail-gateway 18.0.1.0.6__py3-none-any.whl → 18.0.1.0.7__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.

@@ -11,7 +11,7 @@ Mail Gateway
11
11
  !! This file is generated by oca-gen-addon-readme !!
12
12
  !! changes will be overwritten. !!
13
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14
- !! source digest: sha256:f042ae145b0736189a89dd44d245529b867dd60ee9eae504028f272b8ee45fd3
14
+ !! source digest: sha256:0b0634f7493ad02adf0c266707e0a1c3148da0809faa29672363c8f924a31ea3
15
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
16
 
17
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "name": "Mail Gateway",
6
6
  "summary": "Base module for gateway communications",
7
- "version": "18.0.1.0.6",
7
+ "version": "18.0.1.0.7",
8
8
  "license": "AGPL-3",
9
9
  "author": "Creu Blanca,Dixmit,Odoo Community Association (OCA)",
10
10
  "website": "https://github.com/OCA/social",
@@ -15,12 +15,14 @@
15
15
  "wizards/mail_message_gateway_link.xml",
16
16
  "wizards/mail_message_gateway_send.xml",
17
17
  "wizards/mail_guest_manage.xml",
18
+ "wizards/mail_resend_message_views.xml",
18
19
  "security/security.xml",
19
20
  "security/ir.model.access.csv",
20
21
  "views/mail_gateway.xml",
21
22
  "views/res_partner_gateway_channel.xml",
22
23
  "views/mail_guest_views.xml",
23
24
  "views/res_users_settings_views.xml",
25
+ "views/mail_notification_views.xml",
24
26
  ],
25
27
  "assets": {
26
28
  "web.assets_backend": [
@@ -210,6 +210,11 @@ msgid ""
210
210
  "found and replaces the author_id field in the chatter."
211
211
  msgstr ""
212
212
 
213
+ #. module: mail_gateway
214
+ #: model:ir.model,name:mail_gateway.model_mail_resend_message
215
+ msgid "Email resend wizard"
216
+ msgstr ""
217
+
213
218
  #. module: mail_gateway
214
219
  #: model:ir.model.fields,help:mail_gateway.field_mail_notification__gateway_failure_reason
215
220
  msgid ""
@@ -281,6 +286,11 @@ msgstr ""
281
286
  msgid "Gateway Notification"
282
287
  msgstr ""
283
288
 
289
+ #. module: mail_gateway
290
+ #: model:ir.model.fields,field_description:mail_gateway.field_mail_resend_message__gateway_notification_ids
291
+ msgid "Gateway Notifications"
292
+ msgstr ""
293
+
284
294
  #. module: mail_gateway
285
295
  #: model:ir.actions.act_window,name:mail_gateway.res_partner_gateway_channel_act_window
286
296
  #: model:ir.ui.menu,name:mail_gateway.res_partner_gateway_channel_menu
@@ -3,6 +3,7 @@
3
3
 
4
4
 
5
5
  from odoo import api, fields, models
6
+ from odoo.tests import RecordCapturer
6
7
 
7
8
  from odoo.addons.mail.tools.discuss import Store
8
9
 
@@ -117,18 +118,33 @@ class MailMessage(models.Model):
117
118
  gateway_channel_id.gateway_token
118
119
  )
119
120
  channel = self.env["discuss.channel"].browse(chat_id)
120
- channel.message_post(**self._get_gateway_thread_message_vals())
121
+ with RecordCapturer(
122
+ self.env["mail.notification"], [("gateway_channel_id", "=", channel.id)]
123
+ ) as capt:
124
+ channel.message_post(**self._get_gateway_thread_message_vals())
121
125
  if not self.gateway_type:
122
126
  self.gateway_type = gateway_channel_id.gateway_id.gateway_type
123
- self.env["mail.notification"].create(
124
- {
125
- "notification_status": "sent",
126
- "mail_message_id": self.id,
127
- "gateway_channel_id": channel.id,
128
- "notification_type": "gateway",
129
- "gateway_type": gateway_channel_id.gateway_id.gateway_type,
130
- }
131
- )
127
+ notification_vals = {
128
+ "notification_status": "sent",
129
+ "mail_message_id": self.id,
130
+ "gateway_channel_id": channel.id,
131
+ "notification_type": "gateway",
132
+ "gateway_type": gateway_channel_id.gateway_id.gateway_type,
133
+ }
134
+ notification = capt.records
135
+ if notification:
136
+ # Set the same gateway_message_id for both notifications.
137
+ # When the webhook is received, both notifications must be updated.
138
+ # For example, when a message is sent from a document(sale.order),
139
+ # one notification is linked to the document,
140
+ # and another notification is linked to the channel.
141
+ notification_vals["gateway_message_id"] = notification.gateway_message_id
142
+ # If there is a notification with status "exception", set failure details
143
+ if notification.failure_type == "unknown":
144
+ notification_vals["failure_type"] = "unknown"
145
+ notification_vals["notification_status"] = "exception"
146
+ notification_vals["failure_reason"] = notification.failure_reason
147
+ self.env["mail.notification"].create(notification_vals)
132
148
  return {}
133
149
 
134
150
  def _get_gateway_thread_message_vals(self):
@@ -48,3 +48,6 @@ class MailNotification(models.Model):
48
48
  raise_exception=raise_exception,
49
49
  parse_mode=parse_mode,
50
50
  )
51
+ # notify user that we have a failure
52
+ if record.failure_type == "unknown":
53
+ record.mail_message_id._notify_message_notification_update()
@@ -372,7 +372,7 @@ ul.auto-toc {
372
372
  !! This file is generated by oca-gen-addon-readme !!
373
373
  !! changes will be overwritten. !!
374
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375
- !! source digest: sha256:f042ae145b0736189a89dd44d245529b867dd60ee9eae504028f272b8ee45fd3
375
+ !! source digest: sha256:0b0634f7493ad02adf0c266707e0a1c3148da0809faa29672363c8f924a31ea3
376
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377
377
  <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/social/tree/18.0/mail_gateway"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_gateway"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/social&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
378
  <p>This module will allow you to integrate an external chat system in your
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <record id="mail_notification_view_tree" model="ir.ui.view">
4
+ <field name="name">view.mail.notification.tree</field>
5
+ <field name="model">mail.notification</field>
6
+ <field name="inherit_id" ref="mail.mail_notification_view_tree" />
7
+ <field name="priority" eval="100" />
8
+ <field name="mode">primary</field>
9
+ <field name="arch" type="xml">
10
+ <xpath expr="//field[@name='failure_type']" position="after">
11
+ <field name="failure_reason" />
12
+ </xpath>
13
+ <xpath expr="//field[@name='res_partner_id']" position="attributes">
14
+ <attribute name="column_invisible">1</attribute>
15
+ </xpath>
16
+ <xpath expr="//field[@name='is_read']" position="attributes">
17
+ <attribute name="column_invisible">1</attribute>
18
+ </xpath>
19
+ </field>
20
+ </record>
21
+ </odoo>
@@ -2,3 +2,4 @@ from . import mail_guest_manage
2
2
  from . import mail_message_gateway_send
3
3
  from . import mail_message_gateway_link
4
4
  from . import mail_compose_gateway_message
5
+ from . import mail_resend_message
@@ -0,0 +1,25 @@
1
+ from odoo import Command, api, fields, models
2
+
3
+
4
+ class MailResendMessage(models.TransientModel):
5
+ _inherit = "mail.resend.message"
6
+
7
+ gateway_notification_ids = fields.Many2many(
8
+ "mail.notification",
9
+ relation="mail_resend_message_gateway_notification_rel",
10
+ string="Gateway Notifications",
11
+ readonly=True,
12
+ )
13
+
14
+ @api.model
15
+ def default_get(self, fields):
16
+ values = super().default_get(fields)
17
+ message_id = self._context.get("mail_message_to_resend")
18
+ if message_id:
19
+ mail_message_id = self.env["mail.message"].browse(message_id)
20
+ notification_ids = mail_message_id.notification_ids.filtered(
21
+ lambda notif: notif.notification_type == "gateway"
22
+ and notif.notification_status == "exception"
23
+ )
24
+ values["gateway_notification_ids"] = [Command.set(notification_ids.ids)]
25
+ return values
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <record id="mail_resend_message_view_form" model="ir.ui.view">
4
+ <field name="name">view.mail.resend.message.form</field>
5
+ <field name="model">mail.resend.message</field>
6
+ <field name="inherit_id" ref="mail.mail_resend_message_view_form" />
7
+ <field name="arch" type="xml">
8
+ <xpath expr="//field[@name='partner_ids']" position="before">
9
+ <field
10
+ name="gateway_notification_ids"
11
+ context="{'list_view_ref': 'mail_gateway.mail_notification_view_tree'}"
12
+ invisible="not gateway_notification_ids"
13
+ />
14
+ </xpath>
15
+ </field>
16
+ </record>
17
+ </odoo>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-mail_gateway
3
- Version: 18.0.1.0.6
3
+ Version: 18.0.1.0.7
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: odoo==18.0.*
6
6
  Summary: Base module for gateway communications
@@ -27,7 +27,7 @@ Mail Gateway
27
27
  !! This file is generated by oca-gen-addon-readme !!
28
28
  !! changes will be overwritten. !!
29
29
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
30
- !! source digest: sha256:f042ae145b0736189a89dd44d245529b867dd60ee9eae504028f272b8ee45fd3
30
+ !! source digest: sha256:0b0634f7493ad02adf0c266707e0a1c3148da0809faa29672363c8f924a31ea3
31
31
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32
32
 
33
33
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -1,20 +1,20 @@
1
- odoo/addons/mail_gateway/README.rst,sha256=IZHKFtGjpkBjmJ0bos2v_4W3pHFfqGIOEmo4NLrk4bU,4144
1
+ odoo/addons/mail_gateway/README.rst,sha256=K15dLXznbxEjhcDfARClrje4CEmdk71H4ppjk4hiunk,4144
2
2
  odoo/addons/mail_gateway/__init__.py,sha256=iuQELiVGB3Fz_4uDneFx3WqB5wu2T1SnjCCzPLN_v5o,123
3
- odoo/addons/mail_gateway/__manifest__.py,sha256=lj50a2aXqWdwhj_qipF3NoSXpEyA8IqAQZcSEu1UR0E,1085
3
+ odoo/addons/mail_gateway/__manifest__.py,sha256=L0A3-wRzr2I-ORUmAjNKpN69guVfqBgqoTKHAA7fnW4,1179
4
4
  odoo/addons/mail_gateway/hooks.py,sha256=hzYop0HgmZ70EFqRsvm2rYNIvN0elqBDHtj7jcBQA0M,357
5
5
  odoo/addons/mail_gateway/controllers/__init__.py,sha256=8X5vKdloSK3ptemPTOXkaR8uUGcXERI2mce41NLH-90,22
6
6
  odoo/addons/mail_gateway/controllers/gateway.py,sha256=G_hScvCHtcOBnMI4AGIlZNI4T0vbgLfFqG7OcFAchnk,2983
7
7
  odoo/addons/mail_gateway/i18n/es.po,sha256=GgzkMcQ0fHLW37DJG0ucU5M1QA9sbmYmBbSkFhKGro4,35978
8
8
  odoo/addons/mail_gateway/i18n/it.po,sha256=JCYjS_8GA3s_8rmr3cj97W1ATTareTvWTAwTcz36MbU,35985
9
- odoo/addons/mail_gateway/i18n/mail_gateway.pot,sha256=A4M0L8WVXa24BLToKq5-eAdUdoozLoQApKALP0MwuH8,30774
9
+ odoo/addons/mail_gateway/i18n/mail_gateway.pot,sha256=9jC2ZEOIa99Ul-7ru--yb7sFJOgeqv5naldBXnjZ778,31072
10
10
  odoo/addons/mail_gateway/models/__init__.py,sha256=rtdkCyZN2etA4mHFtxp2JmLILlBE-Ytln_1MYUZQ4Ys,313
11
11
  odoo/addons/mail_gateway/models/discuss_channel.py,sha256=NCBLWZGpJZcWdfzYLhL3s88b3FOBcwk1UEbbuc5uUik,3451
12
12
  odoo/addons/mail_gateway/models/ir_websocket.py,sha256=HfdL88oewFlJsjaizT24M52aqU7mRruK28XCo3tSsYU,709
13
13
  odoo/addons/mail_gateway/models/mail_gateway.py,sha256=OlcT4H3PImRbRt-yrtm1FkA7Mq36KsB92tuOX-5eXvA,4691
14
14
  odoo/addons/mail_gateway/models/mail_gateway_abstract.py,sha256=cdpxW6tevrVGFMI3OX8nYXKyOakyfTKEW3t2iP3j1Ow,2623
15
15
  odoo/addons/mail_gateway/models/mail_guest.py,sha256=CZjFNtTSY5vlFbOY7DzxbTKJtvZudzvzpWMLxgVdX58,612
16
- odoo/addons/mail_gateway/models/mail_message.py,sha256=FOGpwFdQsCGghGSl_7ex4PAb7hoVOw8Kd0Td-Y4x76M,5104
17
- odoo/addons/mail_gateway/models/mail_notification.py,sha256=W2l6EVQlhbSTVstHwjiIHkKlMaVkNpo1taUnSnxm5EI,1744
16
+ odoo/addons/mail_gateway/models/mail_message.py,sha256=5_Dy4s0O3ybLEH_yU5VCJlCBvLMp1yrxjgJO08t4Mds,6134
17
+ odoo/addons/mail_gateway/models/mail_notification.py,sha256=FRBYU01CmXqVw13hOUGpEE13E4sbuqrkNnnOBrldZ6Y,1919
18
18
  odoo/addons/mail_gateway/models/mail_thread.py,sha256=pCljZTfGq166eMGpRr_ScxoSF-Y1RZ-ngjrwpNZ5CqY,5205
19
19
  odoo/addons/mail_gateway/models/res_partner.py,sha256=IA8t0LjDHAFEixMHUetwZcEkGSI-MLq6u3koMyxFV_M,2858
20
20
  odoo/addons/mail_gateway/models/res_users.py,sha256=TVioI28j3Epo7dJObM7aULuFeiU10PTA3z2LuelBRiA,407
@@ -28,7 +28,7 @@ odoo/addons/mail_gateway/readme/USAGE.md,sha256=SaA5U50JiORCZ8TtFe6jLORC79xTbnZw
28
28
  odoo/addons/mail_gateway/security/ir.model.access.csv,sha256=sz0zqOt9AoGgl1RYi-_uBisRCqHKOwMPfit72gh7Hyo,1275
29
29
  odoo/addons/mail_gateway/security/security.xml,sha256=fYvvHX2gFDzIxpljrb4gg9cQCz9thnPGUDPuJ5VPrKw,2831
30
30
  odoo/addons/mail_gateway/static/description/icon.png,sha256=oJUSI4t4BOGKGTvPJURptNJVoX1tYOK4oNzcS0ysedI,26508
31
- odoo/addons/mail_gateway/static/description/index.html,sha256=h-v6-fp8ooUQwV0NoXFd6p6ymX1BwHFJpTPTRMqfikg,14190
31
+ odoo/addons/mail_gateway/static/description/index.html,sha256=V3o7bgbnVA-8JJW_4rVH6pV6LFI4_PhIagfdG8pksgc,14190
32
32
  odoo/addons/mail_gateway/static/src/components/chatter/chatter.esm.js,sha256=kawFCUAZ47s6PJzWTwA5i6FuU20YMrvN4PtXq0LHI5o,434
33
33
  odoo/addons/mail_gateway/static/src/components/chatter/chatter.xml,sha256=TFaP0bfhtnOFTPLUgNf29reE2Gk2loIDQcVO7KbUHYI,2301
34
34
  odoo/addons/mail_gateway/static/src/components/composer/composer.esm.js,sha256=2-k8Agn_rZpRUnZHMlVWkLlr26MnLaHyACbGnTRJ2OU,4115
@@ -62,9 +62,10 @@ odoo/addons/mail_gateway/tools/__init__.py,sha256=PmlCraEIi8uVlgGBYWgPp1rmnQN-aw
62
62
  odoo/addons/mail_gateway/tools/discuss.py,sha256=6-lahsV0-FsH82ZQgLQHVryesyzCMNK7ZxFMBEDIpH8,498
63
63
  odoo/addons/mail_gateway/views/mail_gateway.xml,sha256=hq-bKg6v0fOIwke5AfcxSJeJsFnKRExParGfuDI5-sU,3984
64
64
  odoo/addons/mail_gateway/views/mail_guest_views.xml,sha256=johBGGUwncfwMRK8zEmAj-9Vt1JFNPsJA7UV4kbgjr4,578
65
+ odoo/addons/mail_gateway/views/mail_notification_views.xml,sha256=HgU9n4FB30g5NBsLvjw71atvZuxRikizUCgywXd9eTM,940
65
66
  odoo/addons/mail_gateway/views/res_partner_gateway_channel.xml,sha256=kcaUQ7Ps9XgoyIFIks09vYdPThzMF69qUCaLpfiCSQs,2320
66
67
  odoo/addons/mail_gateway/views/res_users_settings_views.xml,sha256=Efhqofgst5YQcGIwD71MyN67bkyB3ftBydKSuzxpGHc,482
67
- odoo/addons/mail_gateway/wizards/__init__.py,sha256=QMbAicNKcX9KktoqCLdR4jW4Poz-5_HAOWNGJABY-HM,155
68
+ odoo/addons/mail_gateway/wizards/__init__.py,sha256=aRcZTiDWv38fmdSfGgXYnQ8stvFuJ5FYlVm_DcfwJss,189
68
69
  odoo/addons/mail_gateway/wizards/mail_compose_gateway_message.py,sha256=Q_fKgLIEhGKV-GILnj2SXIW0g1qe-ziEiSy4j38gcd4,2935
69
70
  odoo/addons/mail_gateway/wizards/mail_compose_gateway_message.xml,sha256=oCyaGocJ7cGSdK_PzFOERMsofJv-5pxDtJzq34splhI,1632
70
71
  odoo/addons/mail_gateway/wizards/mail_guest_manage.py,sha256=YoDFVfgteE8vqUqKb6l3kGwrCVSF1seLzbZjkDfoEcc,1868
@@ -73,7 +74,9 @@ odoo/addons/mail_gateway/wizards/mail_message_gateway_link.py,sha256=cLHK1pu8ncT
73
74
  odoo/addons/mail_gateway/wizards/mail_message_gateway_link.xml,sha256=Y1v9KXo2rf_-gf5JG8HG5tj3BDLZfXFGqT-439xsi2w,974
74
75
  odoo/addons/mail_gateway/wizards/mail_message_gateway_send.py,sha256=b85udBKvs59X5J4x0XhNjE8Ap3TjA6Z-JWc2HCjs5wQ,599
75
76
  odoo/addons/mail_gateway/wizards/mail_message_gateway_send.xml,sha256=tFtD5eTXp9VGRzR0TH6ELx0DOYBjTW4wm_pebSFXBd8,1417
76
- odoo_addon_mail_gateway-18.0.1.0.6.dist-info/METADATA,sha256=ux9IdkJ_NoeN0-ud37l1JINZF4DThmoBNwXDuAe52hE,4699
77
- odoo_addon_mail_gateway-18.0.1.0.6.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
78
- odoo_addon_mail_gateway-18.0.1.0.6.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
79
- odoo_addon_mail_gateway-18.0.1.0.6.dist-info/RECORD,,
77
+ odoo/addons/mail_gateway/wizards/mail_resend_message.py,sha256=L6VEDsjMHzJG19JiXSMQ7LjJqFY0uePeeAFaiZv60b4,927
78
+ odoo/addons/mail_gateway/wizards/mail_resend_message_views.xml,sha256=izjRcKuPlyUapBtxZwsU5yMFBN5klt4UzBAxWymMpsw,732
79
+ odoo_addon_mail_gateway-18.0.1.0.7.dist-info/METADATA,sha256=nV6yeRy6Vn5Xxpu5LbwhTgQBnEOvicX05asNL3x4REE,4699
80
+ odoo_addon_mail_gateway-18.0.1.0.7.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
81
+ odoo_addon_mail_gateway-18.0.1.0.7.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
82
+ odoo_addon_mail_gateway-18.0.1.0.7.dist-info/RECORD,,