From b022650521e02159efe9de1041b6993874af03d5 Mon Sep 17 00:00:00 2001 From: trisdoan Date: Thu, 3 Oct 2024 11:43:22 +0700 Subject: [PATCH] [IMP] mail_tracking: pre-commit auto fixes --- mail_tracking/README.rst | 40 ++-- mail_tracking/__manifest__.py | 2 +- mail_tracking/demo/demo.xml | 196 ++++++++---------- .../security/mail_tracking_email_security.xml | 20 +- mail_tracking/static/description/index.html | 32 +-- .../failed_message/failed_message.xml | 76 +++---- .../failed_message_review.xml | 10 +- .../static/src/core/chatter/chatter.xml | 4 +- mail_tracking/tests/test_mail_tracking.py | 7 +- mail_tracking/views/mail_message_view.xml | 2 - .../views/mail_tracking_email_view.xml | 3 - .../views/mail_tracking_event_view.xml | 3 - mail_tracking/views/res_config_settings.xml | 46 ++-- mail_tracking/views/res_partner_view.xml | 58 +++--- 14 files changed, 240 insertions(+), 259 deletions(-) diff --git a/mail_tracking/README.rst b/mail_tracking/README.rst index e664ad98..70744a2a 100644 --- a/mail_tracking/README.rst +++ b/mail_tracking/README.rst @@ -16,14 +16,14 @@ Email tracking .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github - :target: https://github.com/OCA/social/tree/17.0/mail_tracking - :alt: OCA/social +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/18.0/mail_tracking + :alt: OCA/mail .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mail_tracking + :target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_tracking :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -109,18 +109,18 @@ records with messages in failed status and that needs an user action. |image2| -.. |unknown| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/unknown.png -.. |waiting| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/waiting.png -.. |error| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/error.png -.. |sent| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/sent.png -.. |delivered| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/delivered.png -.. |opened| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/opened.png -.. |cc| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/cc.png -.. |noemail| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/no_email.png -.. |anonuser| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/src/img/anon_user.png -.. |image| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/img/failed_message_discuss.png -.. |image1| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/img/failed_message_widget.png -.. |image2| image:: https://raw.githubusercontent.com/OCA/social/17.0/mail_tracking/static/img/failed_message_filter.png +.. |unknown| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/unknown.png +.. |waiting| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/waiting.png +.. |error| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/error.png +.. |sent| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/sent.png +.. |delivered| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/delivered.png +.. |opened| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/opened.png +.. |cc| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/cc.png +.. |noemail| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/no_email.png +.. |anonuser| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/src/img/anon_user.png +.. |image| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/img/failed_message_discuss.png +.. |image1| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/img/failed_message_widget.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_tracking/static/img/failed_message_filter.png Known issues / Roadmap ====================== @@ -132,10 +132,10 @@ Known issues / Roadmap Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -180,6 +180,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/social `_ project on GitHub. +This module is part of the `OCA/mail `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_tracking/__manifest__.py b/mail_tracking/__manifest__.py index bb7db764..51591765 100644 --- a/mail_tracking/__manifest__.py +++ b/mail_tracking/__manifest__.py @@ -9,7 +9,7 @@ "summary": "Email tracking system for all mails sent", "version": "17.0.1.0.0", "category": "Social Network", - "website": "https://github.com/OCA/social", + "website": "https://github.com/OCA/mail", "author": ("Tecnativa, Odoo Community Association (OCA)"), "license": "AGPL-3", "application": False, diff --git a/mail_tracking/demo/demo.xml b/mail_tracking/demo/demo.xml index 285cb9f6..a84fc886 100644 --- a/mail_tracking/demo/demo.xml +++ b/mail_tracking/demo/demo.xml @@ -1,125 +1,113 @@ - - - res.partner - - comment - - + + res.partner + + comment + + acc@testmail.com,wood.corner26@example.com,toni.rhodes11@example.com - 1 - This is a message with CC

]]>
- wood.corner26@example.com - - - Message with CC -
+ 1 + This is a message with CC

]]>
+ wood.corner26@example.com + + + Message with CC +
- - Message with CC - - - demo@yourcompany.example.com - wood.corner26@example.com - sent - - + + Message with CC + + + demo@yourcompany.example.com + wood.corner26@example.com + sent + + - - - res.partner - - comment - - 1 - This is a failed message

]]>
- wood.corner26@example.com - - - + + res.partner + + comment + + 1 + This is a failed message

]]>
+ wood.corner26@example.com + + + - Failed Message -
+ Failed Message +
- - Failed Message - - - demo@yourcompany.example.com - wood.corner26@example.com - error - - + + Failed Message + + + demo@yourcompany.example.com + wood.corner26@example.com + error + + - - - res.partner - - comment - - 1 - This is another failed message

]]>
- jackson.group82@example.com - - - + + res.partner + + comment + + 1 + This is another failed message

]]>
+ jackson.group82@example.com + + + - Failed Message -
+ Failed Message +
- - Failed Message - - - demo@yourcompany.example.com - jackson.group82@example.com - error - - + + Failed Message + + + demo@yourcompany.example.com + jackson.group82@example.com + error + + - - - res.partner - - comment - - 1 - This is another failed message

]]>
- admin@example.com - - - + + res.partner + + comment + + 1 + This is another failed message

]]>
+ admin@example.com + + + - Failed Message -
+ Failed Message +
- - Failed Message - - - demo@yourcompany.example.com - admin@example.com - error - - + + Failed Message + + + demo@yourcompany.example.com + admin@example.com + error + +
diff --git a/mail_tracking/security/mail_tracking_email_security.xml b/mail_tracking/security/mail_tracking_email_security.xml index 70c70cf1..a4dde23e 100644 --- a/mail_tracking/security/mail_tracking_email_security.xml +++ b/mail_tracking/security/mail_tracking_email_security.xml @@ -2,20 +2,18 @@ - - - + mail_tracking_email: portal/public: read access on my email trackings - - [('partner_id', '=', user.partner_id.id)] - + [('partner_id', '=', user.partner_id.id)] + - - - - - + + + + diff --git a/mail_tracking/static/description/index.html b/mail_tracking/static/description/index.html index 12253cdf..9ea113be 100644 --- a/mail_tracking/static/description/index.html +++ b/mail_tracking/static/description/index.html @@ -369,7 +369,7 @@

Email tracking

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:4200ac4bff2074cc5cd4c3123c5b3082bfb43deef7b2ab228735d52efa105820 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

This module shows email notification tracking status for any messages in mail thread (chatter). Each notified partner will have an intuitive icon just right to his name.

@@ -412,17 +412,17 @@

Usage

notification. Then a status icon will appear just right to name of notified partner.

These are all available status icons:

-

unknown Unknown: No email tracking info available. Maybe this +

unknown Unknown: No email tracking info available. Maybe this notified partner has ‘Receive Inbox Notifications by Email’ == ‘Never’

-

waiting Waiting: Waiting to be sent

-

error Error: Error while sending

-

sent Sent: Sent to SMTP server configured

-

delivered Delivered: Delivered to final MX server

-

opened Opened: Opened by partner

-

cc Cc: It’s a Carbon-Copy recipient. Can’t know the status so is +

waiting Waiting: Waiting to be sent

+

error Error: Error while sending

+

sent Sent: Sent to SMTP server configured

+

delivered Delivered: Delivered to final MX server

+

opened Opened: Opened by partner

+

cc Cc: It’s a Carbon-Copy recipient. Can’t know the status so is ‘Unknown’

-

noemail No Email: The partner doesn’t have a defined email

-

anonuser No Partner: The recipient doesn’t have a defined partner

+

noemail No Email: The partner doesn’t have a defined email

+

anonuser No Partner: The recipient doesn’t have a defined partner

If you want to see all tracking emails and events you can go to

  • Settings > Technical > Email > Tracking emails
  • @@ -433,17 +433,17 @@

    Usage

    too.

    • Discuss

      -

      image

      +

      image

    • Chatter

      -

      image1

      +

      image1

    You can use “Failed sent messages” filter present in all views to show records with messages in failed status and that needs an user action.

    • Filter

      -

      image2

      +

      image2

    @@ -457,10 +457,10 @@

    Known issues / Roadmap

    Bug Tracker

    -

    Bugs are tracked on GitHub Issues. +

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

    +feedback.

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

    @@ -502,7 +502,7 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/social project on GitHub.

    +

    This module is part of the OCA/mail project on GitHub.

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

    diff --git a/mail_tracking/static/src/components/failed_message/failed_message.xml b/mail_tracking/static/src/components/failed_message/failed_message.xml index 474b4b55..db67e929 100644 --- a/mail_tracking/static/src/components/failed_message/failed_message.xml +++ b/mail_tracking/static/src/components/failed_message/failed_message.xml @@ -2,11 +2,13 @@ -
    -
    -
    -
    - +
    +
    +
    +
    -
    -
    -
    - +
    +
    + - + - - + + + + - - -
    -
    - - - + -
    - Failed Recipients: - +
    +
    + Failed Recipients: + -
    -
    +
    - Subject: - + +
    -
    - + diff --git a/mail_tracking/static/src/components/failed_message_review/failed_message_review.xml b/mail_tracking/static/src/components/failed_message_review/failed_message_review.xml index 8fd7cab3..57b68919 100644 --- a/mail_tracking/static/src/components/failed_message_review/failed_message_review.xml +++ b/mail_tracking/static/src/components/failed_message_review/failed_message_review.xml @@ -2,8 +2,8 @@ - - + Set as Reviewed - Retry - - + + diff --git a/mail_tracking/static/src/core/chatter/chatter.xml b/mail_tracking/static/src/core/chatter/chatter.xml index 75a9d444..4f14c979 100644 --- a/mail_tracking/static/src/core/chatter/chatter.xml +++ b/mail_tracking/static/src/core/chatter/chatter.xml @@ -16,7 +16,9 @@ + > + +

    diff --git a/mail_tracking/tests/test_mail_tracking.py b/mail_tracking/tests/test_mail_tracking.py index e07a873f..a4c255e2 100644 --- a/mail_tracking/tests/test_mail_tracking.py +++ b/mail_tracking/tests/test_mail_tracking.py @@ -478,9 +478,10 @@ def test_db_env_no_cr(self): db = self.env.cr.dbname controller = MailTrackingController() # Cast Cursor to Mock object to avoid raising 'Cursor not closed explicitly' log - with patch("odoo.sql_db.db_connect"), patch( - "odoo.http.db_filter" - ) as mock_client: + with ( + patch("odoo.sql_db.db_connect"), + patch("odoo.http.db_filter") as mock_client, + ): mock_client.return_value = True mail, tracking = self.mail_send(self.recipient.email) response = controller.mail_tracking_open(db, tracking.id, False) diff --git a/mail_tracking/views/mail_message_view.xml b/mail_tracking/views/mail_message_view.xml index 96899c87..a1d5dc21 100644 --- a/mail_tracking/views/mail_message_view.xml +++ b/mail_tracking/views/mail_message_view.xml @@ -1,6 +1,5 @@ - mail.message @@ -10,5 +9,4 @@ - diff --git a/mail_tracking/views/mail_tracking_email_view.xml b/mail_tracking/views/mail_tracking_email_view.xml index 94bfa2af..a6ec2f34 100644 --- a/mail_tracking/views/mail_tracking_email_view.xml +++ b/mail_tracking/views/mail_tracking_email_view.xml @@ -2,7 +2,6 @@ - mail.tracking.email.form mail.tracking.email @@ -168,7 +167,6 @@ - MailTracking emails mail.tracking.email @@ -183,5 +181,4 @@ parent="base.menu_email" action="action_view_mail_tracking_email" /> - diff --git a/mail_tracking/views/mail_tracking_event_view.xml b/mail_tracking/views/mail_tracking_event_view.xml index 1fb83893..8c946c16 100644 --- a/mail_tracking/views/mail_tracking_event_view.xml +++ b/mail_tracking/views/mail_tracking_event_view.xml @@ -2,7 +2,6 @@ - mail.tracking.event.form mail.tracking.event @@ -199,6 +198,4 @@ parent="base.menu_email" action="action_view_mail_tracking_event" /> - - diff --git a/mail_tracking/views/res_config_settings.xml b/mail_tracking/views/res_config_settings.xml index cad361fd..bde26f21 100644 --- a/mail_tracking/views/res_config_settings.xml +++ b/mail_tracking/views/res_config_settings.xml @@ -1,35 +1,35 @@ - - res.config.settings.view.form.inherit.mail.tracking - res.config.settings - - - - - -
    -