Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] mail_activity_reminder: Migration to 18.0 #19

Open
wants to merge 31 commits into
base: 18.0
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9ff2330
[ADD] mail_activity_reminder
alexey-pelykh Feb 13, 2020
6685d31
[UPD] Update mail_activity_reminder.pot
oca-travis May 7, 2020
6f403c9
[UPD] README.rst
OCA-git-bot May 7, 2020
0c130f0
[ADD] icon.png
OCA-git-bot May 7, 2020
2f30b6e
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 4, 2020
e55efb0
[UPD] README.rst
OCA-git-bot Nov 10, 2020
55d982a
mail_activity_reminder 12.0.1.0.1
OCA-git-bot Nov 10, 2020
7b6360d
Added translation using Weblate (Portuguese)
pedrocs-exo May 11, 2021
096cfd2
Translated using Weblate (Portuguese)
pedrocs-exo May 11, 2021
41ef36d
Added translation using Weblate (French)
ypapouin Oct 20, 2022
fa4faff
Translated using Weblate (French)
ypapouin Oct 20, 2022
de72a69
[IMP] mail_activity_reminder: black, isort, prettier
rousseldenis Apr 21, 2023
0aa0ab6
[MIG][13.0] mail_activity_reminder
rousseldenis Apr 21, 2023
930a16a
[IMP] mail_activity_reminder: Group sendings per user and activity type
rousseldenis Apr 22, 2023
75cb247
[IMP] mail_activity_reminder: pre-commit stuff
sebalix Oct 9, 2023
dc12bec
[MIG] mail_activity_reminder: Migration to 16.0
sebalix Oct 9, 2023
dd54c16
[UPD] Update mail_activity_reminder.pot
Oct 13, 2023
b08cc56
[BOT] post-merge updates
OCA-git-bot Oct 13, 2023
471b1f2
Update translation files
weblate Oct 13, 2023
10539e0
Added translation using Weblate (Spanish)
Ivorra78 Nov 8, 2023
469cda7
Translated using Weblate (Spanish)
Ivorra78 Nov 8, 2023
69ab6d6
Added translation using Weblate (Italian)
mymage Dec 1, 2023
27877f2
Translated using Weblate (Italian)
mymage Dec 7, 2023
cda814c
[IMP] mail_activity_reminder: pre-commit auto fixes
bizzappdev Apr 9, 2024
9dd8ffd
[MIG] mail_activity_reminder: Migration to 17.0
bizzappdev Apr 9, 2024
8b93646
[UPD] Update mail_activity_reminder.pot
Aug 29, 2024
33552c0
[BOT] post-merge updates
OCA-git-bot Aug 29, 2024
8b91b2c
Update translation files
weblate Aug 29, 2024
a000dc1
Translated using Weblate (Italian)
mymage Aug 30, 2024
9d14599
[IMP] mail_activity_reminder: pre-commit auto fixes
achulii Nov 27, 2024
671cb68
[MIG] mail_activity_reminder: Migration to 18.0
achulii Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[MIG][13.0] mail_activity_reminder
rousseldenis authored and achulii committed Nov 27, 2024
commit 0aa0ab6c2f351b57e77a07ea217f26dc0ac8011d
12 changes: 7 additions & 5 deletions mail_activity_reminder/README.rst
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@ Mail Activity Reminder
: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/12.0/mail_activity_reminder
:target: https://github.com/OCA/social/tree/13.0/mail_activity_reminder
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-12-0/social-12-0-mail_activity_reminder
:target: https://translation.odoo-community.org/projects/social-13-0/social-13-0-mail_activity_reminder
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/205/12.0
:target: https://runbot.odoo-community.org/runbot/205/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -55,7 +55,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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_activity_reminder%0Aversion:%2012.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_activity_reminder%0Aversion:%2013.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.

@@ -74,6 +74,8 @@ Contributors

* Alexey Pelykh <alexey.pelykh@corphub.eu>

* Denis Roussel <denis.roussel@acsone.eu>

Maintainers
~~~~~~~~~~~

@@ -87,6 +89,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/12.0/mail_activity_reminder>`_ project on GitHub.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/13.0/mail_activity_reminder>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
10 changes: 4 additions & 6 deletions mail_activity_reminder/__manifest__.py
Original file line number Diff line number Diff line change
@@ -4,14 +4,12 @@

{
"name": "Mail Activity Reminder",
"version": "12.0.1.0.1",
"version": "13.0.1.0.0",
"category": "Discuss",
"website": "https://github.com/OCA/social",
"author": "CorporateHub, " "Odoo Community Association (OCA)",
"author": "CorporateHub, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"application": False,
"summary": "Reminder notifications about planned activities",
"depends": ["mail",],
"data": ["data/mail_activity_reminder_cron.xml", "views/mail_activity_type.xml",],
"depends": ["mail"],
"data": ["data/mail_activity_reminder_cron.xml", "views/mail_activity_type.xml"],
}
4 changes: 0 additions & 4 deletions mail_activity_reminder/models/mail_activity.py
Original file line number Diff line number Diff line change
@@ -41,7 +41,6 @@ def _process_reminders(self):
activities.action_remind()
return activities

@api.multi
@api.depends(
"user_id.tz", "activity_type_id.reminders", "deadline", "last_reminder_local",
)
@@ -79,7 +78,6 @@ def _compute_next_reminder(self):
tzinfo=None
)

@api.multi
@api.depends("user_id.tz", "date_deadline")
def _compute_deadline(self):
for activity in self:
@@ -90,7 +88,6 @@ def _compute_deadline(self):
.replace(tzinfo=None)
)

@api.multi
def action_notify(self):
super().action_notify()
utc_now = fields.Datetime.now().replace(tzinfo=UTC)
@@ -100,7 +97,6 @@ def action_notify(self):
tz = timezone(activity.user_id.sudo().tz or "UTC")
activity.last_reminder_local = utc_now.astimezone(tz).replace(tzinfo=None)

@api.multi
def action_remind(self):
IrModel = self.env["ir.model"]
MailThread = self.env["mail.thread"]
3 changes: 1 addition & 2 deletions mail_activity_reminder/models/mail_activity_type.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

from re import split

from odoo import api, fields, models
from odoo import fields, models


class MailActivityType(models.Model):
@@ -18,7 +18,6 @@ class MailActivityType(models.Model):
),
)

@api.multi
def _get_reminder_offsets(self):
"""Hook for extensions"""
self.ensure_one()
2 changes: 2 additions & 0 deletions mail_activity_reminder/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* `CorporateHub <https://corporatehub.eu/>`__

* Alexey Pelykh <alexey.pelykh@corphub.eu>

* Denis Roussel <denis.roussel@acsone.eu>
9 changes: 5 additions & 4 deletions mail_activity_reminder/static/description/index.html
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Mail Activity Reminder</title>
<style type="text/css">

@@ -367,7 +367,7 @@ <h1 class="title">Mail Activity Reminder</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/social/tree/12.0/mail_activity_reminder"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/social-12-0/social-12-0-mail_activity_reminder"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/205/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/social/tree/13.0/mail_activity_reminder"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/social-13-0/social-13-0-mail_activity_reminder"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/205/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows setting reminders for various Activity Types.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
@@ -408,7 +408,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_activity_reminder%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_activity_reminder%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -426,6 +426,7 @@ <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<li>Alexey Pelykh &lt;<a class="reference external" href="mailto:alexey.pelykh&#64;corphub.eu">alexey.pelykh&#64;corphub.eu</a>&gt;</li>
</ul>
</li>
<li>Denis Roussel &lt;<a class="reference external" href="mailto:denis.roussel&#64;acsone.eu">denis.roussel&#64;acsone.eu</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -435,7 +436,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/12.0/mail_activity_reminder">OCA/social</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/13.0/mail_activity_reminder">OCA/social</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
16 changes: 8 additions & 8 deletions mail_activity_reminder/tests/test_mail_activity_reminder.py
Original file line number Diff line number Diff line change
@@ -34,24 +34,24 @@ def setUpClass(cls):
)

def test_none_reminders(self):
activity_type = self.MailActivityType.create({"name": "Activity Type",})
activity_type = self.MailActivityType.create({"name": "Activity Type"})
self.assertEqual(activity_type._get_reminder_offsets(), [])

def test_empty_reminders(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": " -./",}
{"name": "Activity Type", "reminders": " -./"}
)
self.assertEqual(activity_type._get_reminder_offsets(), [])

def test_delimiters(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": "0 1_2/3.4t5",}
{"name": "Activity Type", "reminders": "0 1_2/3.4t5"}
)
self.assertEqual(activity_type._get_reminder_offsets(), [0, 1, 2, 3, 4, 5])

def test_first_notice_is_reminder(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": "0",}
{"name": "Activity Type", "reminders": "0"}
)
user = self.ResUsers.sudo().create(
{
@@ -76,7 +76,7 @@ def test_first_notice_is_reminder(self):

def test_reminder_behaviour(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": "0/2",}
{"name": "Activity Type", "reminders": "0/2"}
)

with freeze_time(self.now):
@@ -119,7 +119,7 @@ def test_reminder_behaviour(self):

def test_reminder_flow(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": "0/2",}
{"name": "Activity Type", "reminders": "0/2"}
)

with freeze_time(self.now):
@@ -155,7 +155,7 @@ def test_reminder_flow(self):

def test_repeated_reminder(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": "0",}
{"name": "Activity Type", "reminders": "0"}
)

with freeze_time(self.now):
@@ -178,7 +178,7 @@ def test_repeated_reminder(self):

def test_overdue_reminder(self):
activity_type = self.MailActivityType.create(
{"name": "Activity Type", "reminders": "0",}
{"name": "Activity Type", "reminders": "0"}
)

with freeze_time(self.now):