Skip to content

Commit 67387f3

Browse files
committed
[IMP] mail_gateway: pre-commit auto fixes
1 parent 496d8c4 commit 67387f3

19 files changed

+84
-67
lines changed

mail_gateway/README.rst

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,25 @@ Mail Gateway
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |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
20+
:target: https://github.com/OCA/social/tree/17.0/mail_gateway
2121
:alt: OCA/social
2222
.. |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
23+
:target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_gateway
2424
:alt: Translate me on Weblate
2525
.. |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
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=17.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

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`.
31+
This module will allow you to integrate an external chat system in your
32+
Odoo system. It requires extra modules with the specific configuration
33+
of each chat system, like mail_gateway_telegram or
34+
mail_gateway_whatsapp.
3335

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+
This way, a group of users can respond customers or any other set of
37+
partners within Odoo, but the messages will be sent through the external
38+
chat system.
3639

3740
**Table of contents**
3841

@@ -42,48 +45,52 @@ of partners within Odoo, but the messages will be sent through the external chat
4245
Usage
4346
=====
4447

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.
48+
When external messages are received, they will be directly sent to the
49+
discuss menu. Answering to these messages will send the answer to the
50+
external contact. We can assign this messages to any record using the
51+
message actions. Also, we can assign the sender to a partner using the
52+
followers menu and selecting the partner.
4953

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
54+
On a standard record associated to a partner with external chat, we can
55+
send messages to the external contact directly selecting the methods of
56+
the partner. To use this, we just need to use the
5257

53-
It is recomended to enable chatter notification to all users that will receive messages from gateways.
58+
It is recomended to enable chatter notification to all users that will
59+
receive messages from gateways.
5460

5561
Bug Tracker
5662
===========
5763

5864
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
5965
In case of trouble, please check there if your issue has already been reported.
6066
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**>`_.
67+
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_gateway%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6268

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

6571
Credits
6672
=======
6773

6874
Authors
69-
~~~~~~~
75+
-------
7076

7177
* Creu Blanca
7278
* Dixmit
7379

7480
Contributors
75-
~~~~~~~~~~~~
81+
------------
7682

77-
* Enric Tobella
78-
* Olga Marco
83+
- Enric Tobella
84+
- Olga Marco
7985

8086
Other credits
81-
~~~~~~~~~~~~~
87+
-------------
8288

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

8592
Maintainers
86-
~~~~~~~~~~~
93+
-----------
8794

8895
This module is maintained by the OCA.
8996

@@ -95,6 +102,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
95102
mission is to support the collaborative development of Odoo features and
96103
promote its widespread use.
97104

98-
This module is part of the `OCA/social <https://github.com/OCA/social/tree/16.0/mail_gateway>`_ project on GitHub.
105+
This module is part of the `OCA/social <https://github.com/OCA/social/tree/17.0/mail_gateway>`_ project on GitHub.
99106

100107
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

mail_gateway/models/mail_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ def _message_update_content_after_hook(self, message):
7474
self.ensure_one()
7575
if self.channel_type == "gateway" and message.gateway_notification_ids:
7676
self.env[
77-
"mail.gateway.{}".format(self.gateway_id.gateway_type)
77+
f"mail.gateway.{self.gateway_id.gateway_type}"
7878
]._update_content_after_hook(self, message)
7979
return super()._message_update_content_after_hook(message=message)

mail_gateway/models/mail_gateway.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def update_webhook(self):
9191
self.set_webhook()
9292

9393
def write(self, vals):
94-
res = super(MailGateway, self).write(vals)
94+
res = super().write(vals)
9595
if (
9696
"webhook_key" in vals
9797
or "integrated_webhook_state" in vals
@@ -103,7 +103,7 @@ def write(self, vals):
103103

104104
@api.model_create_multi
105105
def create(self, mvals):
106-
res = super(MailGateway, self).create(mvals)
106+
res = super().create(mvals)
107107
self.clear_caches()
108108
return res
109109

mail_gateway/models/mail_message.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class MailMessage(models.Model):
9-
109
_inherit = "mail.message"
1110

1211
gateway_type = fields.Selection(

mail_gateway/models/res_partner.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ def name_get(self):
7878
result.append(
7979
(
8080
record.id,
81-
"{} ({})".format(
82-
record.partner_id.display_name, origin_dict[record.id]
83-
),
81+
f"{record.partner_id.display_name} ({origin_dict[record.id]})",
8482
)
8583
)
8684
return result

mail_gateway/models/res_users.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class ResUsers(models.Model):
8-
98
_inherit = "res.users"
109

1110
gateway_ids = fields.Many2many("mail.gateway")

mail_gateway/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Enric Tobella
2+
- Olga Marco

mail_gateway/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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>)

0 commit comments

Comments
 (0)