diff --git a/task_deadline_reminder/README.rst b/task_deadline_reminder/README.rst new file mode 100644 index 000000000..71fe6ba03 --- /dev/null +++ b/task_deadline_reminder/README.rst @@ -0,0 +1,58 @@ +Task DeadLine Reminder v11 +========================== +This module extends the functionality of project module to allow to send deadline reminder emails on task deadline day. + +Configuration +============= + +By default, a cron job named "Task DeadLine Reminder" will be created while installing this module. +This cron job can be found in: + + **Settings > Technical > Automation > Scheduled Actions** + +This job runs daily by default. + +Usage +===== + +To use this functionality, you need to: + +#. Create a project to which the new tasks will be related. +#. Add a name, deadline date, who the task will be assigned to, etc... +#. In order to send email reminder to responsible user,you have to set reminder box (Project > Task > Reminder ) +#. Go to the Scheduled Action(Settings > Technical > Automation > Scheduled Action) and edit the time at which Deadline Reminder Action is to be done + +The cron job will do the rest. + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Developer v9: Saritha @ cybrosys +* Developer v10, v11: Niyas Raphy @ cybrosys + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + + + + + + + + diff --git a/task_deadline_reminder/__init__.py b/task_deadline_reminder/__init__.py new file mode 100755 index 000000000..167c5926c --- /dev/null +++ b/task_deadline_reminder/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies ().# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models + + + diff --git a/task_deadline_reminder/__manifest__.py b/task_deadline_reminder/__manifest__.py new file mode 100644 index 000000000..9d3f8dcef --- /dev/null +++ b/task_deadline_reminder/__manifest__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################### +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies ().# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': "Task Deadline Reminder", + 'version': "11.0.1.0.0", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'summary': '''Automatically Send Mail To Responsible User if Deadline Of Task is Today''', + 'description': '''Automatically Send Mail To Responsible User if Deadline Of Task is Today''', + 'category': "Project", + 'depends': ['project'], + 'license': 'AGPL-3', + 'data': [ + 'views/deadline_reminder_view.xml', + 'views/deadline_reminder_cron.xml', + 'data/deadline_reminder_action_data.xml' + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False +} diff --git a/task_deadline_reminder/data/deadline_reminder_action_data.xml b/task_deadline_reminder/data/deadline_reminder_action_data.xml new file mode 100755 index 000000000..37358154d --- /dev/null +++ b/task_deadline_reminder/data/deadline_reminder_action_data.xml @@ -0,0 +1,46 @@ + + + + + + Deadline Reminder...!! + ${object.company_id.name}<${object.company_id.email}> + ${object.user_id.email} + Today Due Task -${object.date_deadline or 'n/a' } + + + +
+

Hello ${object.user_id.name},

+

This Email Is To Remind You That You Have Task As Below Listed Which Are Due On Today.

+
+
+ + + + + + + + + + + + + + + + + + + +
TaskProjectDeadlineAssigned ToLink
${object.name}${object.project_id.name}${object.date_deadline}${object.user_id.name}View Now
+
+ + ]]> +
+
+ +
+
diff --git a/task_deadline_reminder/models/__init__.py b/task_deadline_reminder/models/__init__.py new file mode 100644 index 000000000..804dd48f7 --- /dev/null +++ b/task_deadline_reminder/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import deadline_reminder + + diff --git a/task_deadline_reminder/models/deadline_reminder.py b/task_deadline_reminder/models/deadline_reminder.py new file mode 100644 index 000000000..2f2dbb120 --- /dev/null +++ b/task_deadline_reminder/models/deadline_reminder.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + +import datetime +from datetime import datetime +from odoo import SUPERUSER_ID +from odoo import api, fields, models, _ + + +class DeadLineReminder(models.Model): + _inherit = "project.task" + + task_reminder = fields.Boolean("Reminder") + + @api.model + def _cron_deadline_reminder(self): + su_id = self.env['res.partner'].browse(SUPERUSER_ID) + for task in self.env['project.task'].search([('date_deadline', '!=', None), + ('task_reminder', '=', True), ('user_id', '!=', None)]): + reminder_date = datetime.strptime(task.date_deadline, '%Y-%m-%d').date() + today = datetime.now().date() + if reminder_date == today and task: + template_id = self.env['ir.model.data'].get_object_reference( + 'task_deadline_reminder', + 'email_template_edi_deadline_reminder')[1] + if template_id: + email_template_obj = self.env['mail.template'].browse(template_id) + values = email_template_obj.generate_email(task.id, fields=None) + values['email_from'] = su_id.email + values['email_to'] = task.user_id.email + values['res_id'] = False + mail_mail_obj = self.env['mail.mail'] + msg_id = mail_mail_obj.create(values) + if msg_id: + msg_id.send() + return True + + diff --git a/task_deadline_reminder/static/description/banner.jpg b/task_deadline_reminder/static/description/banner.jpg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/task_deadline_reminder/static/description/banner.jpg differ diff --git a/task_deadline_reminder/static/description/cybro_logo.png b/task_deadline_reminder/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/task_deadline_reminder/static/description/cybro_logo.png differ diff --git a/task_deadline_reminder/static/description/icon.png b/task_deadline_reminder/static/description/icon.png new file mode 100644 index 000000000..1ff90030a Binary files /dev/null and b/task_deadline_reminder/static/description/icon.png differ diff --git a/task_deadline_reminder/static/description/index.html b/task_deadline_reminder/static/description/index.html new file mode 100644 index 000000000..05b294051 --- /dev/null +++ b/task_deadline_reminder/static/description/index.html @@ -0,0 +1,76 @@ + + + + +
+
+

Task DeadLine Reminder

+
+

+ This module send auto reminder to responsible user of task if deadline = Today. Cron job will + run everyday and search for task which due today and send reminder email to employee. +

+
+
+
+ +
+
+

Project Task Form - Configuration of Task Deadline Reminder

+
+

+ If set this box then only this task will be consider for reminder. +

+
+
+
+ +
+
+
+
+ +
+
+

Automation Scheduled Action - Cron Job

+
+
+ +
+
+
+
+ +
+
+

Email to User/Employee

+
+

+ View Now link will allow user to jump to related task directly. This email will group all tasks which are deadline today for that user and send summary table to user/employee by email. +

+
+
+
+ +
+
+
+
+
+

Need Any Help?

+ + +
+ + + diff --git a/task_deadline_reminder/static/description/mail.png b/task_deadline_reminder/static/description/mail.png new file mode 100644 index 000000000..1fa50b2c0 Binary files /dev/null and b/task_deadline_reminder/static/description/mail.png differ diff --git a/task_deadline_reminder/static/description/project_task_form.jpg b/task_deadline_reminder/static/description/project_task_form.jpg new file mode 100644 index 000000000..2cf1752f9 Binary files /dev/null and b/task_deadline_reminder/static/description/project_task_form.jpg differ diff --git a/task_deadline_reminder/static/description/scheduled_action_form.png b/task_deadline_reminder/static/description/scheduled_action_form.png new file mode 100644 index 000000000..099bfb24a Binary files /dev/null and b/task_deadline_reminder/static/description/scheduled_action_form.png differ diff --git a/task_deadline_reminder/views/deadline_reminder_cron.xml b/task_deadline_reminder/views/deadline_reminder_cron.xml new file mode 100644 index 000000000..1117f19b0 --- /dev/null +++ b/task_deadline_reminder/views/deadline_reminder_cron.xml @@ -0,0 +1,16 @@ + + + + + Task DeadLine Reminder + + code + model._cron_deadline_reminder() + + 1 + days + -1 + + + + diff --git a/task_deadline_reminder/views/deadline_reminder_view.xml b/task_deadline_reminder/views/deadline_reminder_view.xml new file mode 100644 index 000000000..3c150738e --- /dev/null +++ b/task_deadline_reminder/views/deadline_reminder_view.xml @@ -0,0 +1,17 @@ + + + + + + ProjectTaskRemainder + project.task + + + + + + + + + + \ No newline at end of file