Skip to content

Commit

Permalink
[IMP] mail_tracking: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
trisdoan committed Oct 23, 2024
1 parent fc98019 commit f98b34c
Show file tree
Hide file tree
Showing 13 changed files with 235 additions and 254 deletions.
34 changes: 17 additions & 17 deletions mail_tracking/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Email tracking
: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
:target: https://github.com/OCA/social/tree/18.0/mail_tracking
:alt: OCA/social
.. |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/social-18-0/social-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/social&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -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/social/18.0/mail_tracking/static/src/img/unknown.png
.. |waiting| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/waiting.png
.. |error| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/error.png
.. |sent| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/sent.png
.. |delivered| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/delivered.png
.. |opened| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/opened.png
.. |cc| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/cc.png
.. |noemail| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/no_email.png
.. |anonuser| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/src/img/anon_user.png
.. |image| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/img/failed_message_discuss.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/img/failed_message_widget.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/social/18.0/mail_tracking/static/img/failed_message_filter.png

Known issues / Roadmap
======================
Expand All @@ -135,7 +135,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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 <https://github.com/OCA/social/issues/new?body=module:%20mail_tracking%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_tracking%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -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 <https://github.com/OCA/social/tree/17.0/mail_tracking>`_ project on GitHub.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/18.0/mail_tracking>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
196 changes: 92 additions & 104 deletions mail_tracking/demo/demo.xml
Original file line number Diff line number Diff line change
@@ -1,125 +1,113 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Message with CC -->
<record id="mail_message_cc" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field
<!-- Message with CC -->
<record id="mail_message_cc" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field
name="email_cc"
>acc@testmail.com,wood.corner26@example.com,toni.rhodes11@example.com</field>
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is a message with CC</p>]]></field>
<field name="email_from">wood.corner26@example.com</field>
<field name="author_id" ref="base.res_partner_1" />
<field
name="partner_ids"
eval="[Command.set([ref('base.partner_demo')])]"
/>
<field name="subject">Message with CC</field>
</record>
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is a message with CC</p>]]></field>
<field name="email_from">wood.corner26@example.com</field>
<field name="author_id" ref="base.res_partner_1" />
<field name="partner_ids" eval="[Command.set([ref('base.partner_demo')])]" />
<field name="subject">Message with CC</field>
</record>

<record id="mail_tracking_email_cc" model="mail.tracking.email">
<field name="name">Message with CC</field>
<field name="mail_message_id" ref="mail_message_cc" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">wood.corner26@example.com</field>
<field name="state">sent</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>
<record id="mail_tracking_email_cc" model="mail.tracking.email">
<field name="name">Message with CC</field>
<field name="mail_message_id" ref="mail_message_cc" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">wood.corner26@example.com</field>
<field name="state">sent</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>

<!-- Failed Message A -->
<record id="mail_message_failed" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is a failed message</p>]]></field>
<field name="email_from">wood.corner26@example.com</field>
<field name="author_id" ref="base.res_partner_1" />
<field
name="partner_ids"
eval="[Command.set([ref('base.partner_demo')])]"
/>
<field
<!-- Failed Message A -->
<record id="mail_message_failed" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is a failed message</p>]]></field>
<field name="email_from">wood.corner26@example.com</field>
<field name="author_id" ref="base.res_partner_1" />
<field name="partner_ids" eval="[Command.set([ref('base.partner_demo')])]" />
<field
name="notification_ids"
eval="[Command.create({'res_partner_id': ref('base.partner_demo')}),Command.create({'res_partner_id': ref('base.res_partner_1'), 'notification_status': 'exception'})]"
/>
<field name="subject">Failed Message</field>
</record>
<field name="subject">Failed Message</field>
</record>

<record id="mail_tracking_email_failed" model="mail.tracking.email">
<field name="name">Failed Message</field>
<field name="mail_message_id" ref="mail_message_failed" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">wood.corner26@example.com</field>
<field name="state">error</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>
<record id="mail_tracking_email_failed" model="mail.tracking.email">
<field name="name">Failed Message</field>
<field name="mail_message_id" ref="mail_message_failed" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">wood.corner26@example.com</field>
<field name="state">error</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>

<!-- Failed Message B -->
<record id="mail_message_failed_b" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is another failed message</p>]]></field>
<field name="email_from">jackson.group82@example.com</field>
<field name="author_id" ref="base.res_partner_10" />
<field
name="partner_ids"
eval="[Command.set([ref('base.partner_demo')])]"
/>
<field
<!-- Failed Message B -->
<record id="mail_message_failed_b" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is another failed message</p>]]></field>
<field name="email_from">jackson.group82@example.com</field>
<field name="author_id" ref="base.res_partner_10" />
<field name="partner_ids" eval="[Command.set([ref('base.partner_demo')])]" />
<field
name="notification_ids"
eval="[Command.create({'res_partner_id': ref('base.partner_demo')}),Command.create({'res_partner_id': ref('base.res_partner_10'), 'notification_status': 'bounce'})]"
/>
<field name="subject">Failed Message</field>
</record>
<field name="subject">Failed Message</field>
</record>

<record id="mail_tracking_email_failed_b" model="mail.tracking.email">
<field name="name">Failed Message</field>
<field name="mail_message_id" ref="mail_message_failed_b" />
<field name="partner_id" ref="base.res_partner_10" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">jackson.group82@example.com</field>
<field name="state">error</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>
<record id="mail_tracking_email_failed_b" model="mail.tracking.email">
<field name="name">Failed Message</field>
<field name="mail_message_id" ref="mail_message_failed_b" />
<field name="partner_id" ref="base.res_partner_10" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">jackson.group82@example.com</field>
<field name="state">error</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>

<!-- Failed Message C -->
<record id="mail_message_failed_c" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is another failed message</p>]]></field>
<field name="email_from">admin@example.com</field>
<field name="author_id" ref="base.partner_admin" />
<field
name="partner_ids"
eval="[Command.set([ref('base.partner_demo')])]"
/>
<field
<!-- Failed Message C -->
<record id="mail_message_failed_c" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.partner_demo" />
<field name="message_type">comment</field>
<field name="subtype_id" ref="mail.mt_comment" />
<field name="mail_tracking_needs_action">1</field>
<field name="body"><![CDATA[<p>This is another failed message</p>]]></field>
<field name="email_from">admin@example.com</field>
<field name="author_id" ref="base.partner_admin" />
<field name="partner_ids" eval="[Command.set([ref('base.partner_demo')])]" />
<field
name="notification_ids"
eval="[Command.create({'res_partner_id': ref('base.partner_demo')}),Command.create({'res_partner_id': ref('base.partner_admin'), 'notification_status': 'exception'})]"
/>
<field name="subject">Failed Message</field>
</record>
<field name="subject">Failed Message</field>
</record>

<record id="mail_tracking_email_failed_c" model="mail.tracking.email">
<field name="name">Failed Message</field>
<field name="mail_message_id" ref="mail_message_failed_c" />
<field name="partner_id" ref="base.partner_admin" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">admin@example.com</field>
<field name="state">error</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>
<record id="mail_tracking_email_failed_c" model="mail.tracking.email">
<field name="name">Failed Message</field>
<field name="mail_message_id" ref="mail_message_failed_c" />
<field name="partner_id" ref="base.partner_admin" />
<field name="recipient">demo@yourcompany.example.com</field>
<field name="sender">admin@example.com</field>
<field name="state">error</field>
<field name="time" eval="DateTime.today().strftime('%Y-%m-%d %H:%M')" />
</record>
</odoo>
20 changes: 9 additions & 11 deletions mail_tracking/security/mail_tracking_email_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
<!-- Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>

<record model="ir.rule" id="mail_tracking_email_portal_public_rule">
<field
<record model="ir.rule" id="mail_tracking_email_portal_public_rule">
<field
name="name"
>mail_tracking_email: portal/public: read access on my email trackings</field>
<field name="model_id" ref="model_mail_tracking_email" />
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
<field
<field name="model_id" ref="model_mail_tracking_email" />
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
<field
name="groups"
eval="[Command.link(ref('base.group_portal')), Command.link(ref('base.group_public'))]"
/>
<field name="perm_create" eval="False" />
<field name="perm_unlink" eval="False" />
<field name="perm_write" eval="False" />
</record>

<field name="perm_create" eval="False" />
<field name="perm_unlink" eval="False" />
<field name="perm_write" eval="False" />
</record>
</odoo>
Loading

0 comments on commit f98b34c

Please sign in to comment.