12 changed files with 282 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||
============================ |
|||
Restricted Task Following v9 |
|||
============================ |
|||
|
|||
This module allow Only assigned & created person will follow the task, Restrict other followers of project. |
|||
|
|||
Installation |
|||
============ |
|||
|
|||
Just select it from available modules to install it, there is no need to extra installations. |
|||
|
|||
Configuration |
|||
============= |
|||
|
|||
* Tick 'Disable Automatic Task Following' boolean field from project master to enable this feature. |
|||
|
|||
Features |
|||
======== |
|||
|
|||
* Option to Disable Automatic Task Following From Project Followers. |
|||
* User Can Add Custom Followers to Task. |
|||
|
|||
Credits |
|||
======= |
|||
Developer: Aswani pc @ cybrosys |
|||
Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in |
|||
|
|||
|
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from . import models |
@ -0,0 +1,39 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': "Disable Auto Task Following", |
|||
'version': '10.0.1.0', |
|||
'summary': """Only assignee & assigned person will follow the task, Restrict other followers of project""", |
|||
'category': 'Project', |
|||
'description': """This module adds an option to remove automatic followers of project on task""", |
|||
'author': "Cybrosys Techno Solutions", |
|||
'company': "Cybrosys Techno Solutions", |
|||
'website': "http://www.cybrosys.com", |
|||
'depends': ['base', 'project'], |
|||
'data': ['views/restrict_task_following.xml'], |
|||
|
|||
'images': ['static/description/banner.jpg'], |
|||
'installable': True, |
|||
'license': 'LGPL-3', |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from . import restrict_task_following |
@ -0,0 +1,92 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Nilmar Shereef(<http://www.cybrosys.com>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from openerp import models, fields, api |
|||
|
|||
|
|||
class TaskFollow(models.Model): |
|||
_inherit = 'project.task' |
|||
|
|||
@api.multi |
|||
def message_auto_subscribe(self, updated_fields, values=None): |
|||
|
|||
""" override 'message_auto_subscribe' function in 'mail.thread' .""" |
|||
|
|||
new_partners, new_channels = dict(), dict() |
|||
restrict_task_follow = self.project_id.restrict_automatic_task_follow |
|||
user_field_lst = self._message_get_auto_subscribe_fields(updated_fields) |
|||
subtypes = self.env['mail.message.subtype'].search( |
|||
['|', ('res_model', '=', False), ('parent_id.res_model', '=', self._name)]) |
|||
relation_fields = set([subtype.relation_field for subtype in subtypes if subtype.relation_field is not False]) |
|||
if not any(relation in updated_fields for relation in relation_fields) and not user_field_lst: |
|||
return True |
|||
if values is None: |
|||
record = self[0] |
|||
for updated_field in updated_fields: |
|||
field_value = getattr(record, updated_field) |
|||
if isinstance(field_value, models.BaseModel): |
|||
field_value = field_value.id |
|||
values[updated_field] = field_value |
|||
headers = set() |
|||
for subtype in subtypes: |
|||
if subtype.relation_field and values.get(subtype.relation_field): |
|||
headers.add((subtype.res_model, values.get(subtype.relation_field))) |
|||
if headers: |
|||
header_domain = ['|'] * (len(headers) - 1) |
|||
for header in headers: |
|||
header_domain += ['&', ('res_model', '=', header[0]), ('res_id', '=', header[1])] |
|||
if not restrict_task_follow: |
|||
for header_follower in self.env['mail.followers'].sudo().search(header_domain): |
|||
for subtype in header_follower.subtype_ids: |
|||
if subtype.parent_id and subtype.parent_id.res_model == self._name: |
|||
new_subtype = subtype.parent_id |
|||
elif subtype.res_model is False: |
|||
new_subtype = subtype |
|||
else: |
|||
continue |
|||
if header_follower.partner_id: |
|||
new_partners.setdefault(header_follower.partner_id.id, set()).add(new_subtype.id) |
|||
else: |
|||
new_channels.setdefault(header_follower.channel_id.id, set()).add(new_subtype.id) |
|||
user_ids = [values[name] for name in user_field_lst if values.get(name)] |
|||
user_pids = [user.partner_id.id for user in self.env['res.users'].sudo().browse(user_ids)] |
|||
for partner_id in user_pids: |
|||
new_partners.setdefault(partner_id, None) |
|||
for pid, subtypes in new_partners.items(): |
|||
subtypes = list(subtypes) if subtypes is not None else None |
|||
self.message_subscribe(partner_ids=[pid], subtype_ids=subtypes, force=(subtypes != None)) |
|||
for cid, subtypes in new_channels.items(): |
|||
subtypes = list(subtypes) if subtypes is not None else None |
|||
self.message_subscribe(channel_ids=[cid], subtype_ids=subtypes, force=(subtypes != None)) |
|||
user_pids = [user_pid for user_pid in user_pids if user_pid != self.env.user.partner_id.id] |
|||
self._message_auto_subscribe_notify(user_pids) |
|||
return True |
|||
|
|||
|
|||
class ProjectFollow(models.Model): |
|||
_inherit = 'project.project' |
|||
|
|||
restrict_automatic_task_follow = fields.Boolean(string="Disable Automatic Task Following", |
|||
help="It will remove unwanted project followers on task." |
|||
"Only assigned person & created person will follow " |
|||
"this task automatically.") |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,60 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_spaced"> |
|||
<h2 class="oe_slogan">Disable Auto Task Following</h2> |
|||
<h3 class="oe_slogan">Only assigned & created person will follow the task, Restrict other followers of project</h3> |
|||
|
|||
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4> |
|||
<h4>Features:</h4> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> →</span> Option to Disable Automatic Task Following From Project Followers</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> →</span> User Can Add Custom Followers to Task</li> |
|||
</ul> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_spaced"> |
|||
<h3 class="oe_slogan">Option Disable Automatic Task Following</h3> |
|||
<div class="oe_demo oe_picture oe_screenshot" style="max-height: 100%;"> |
|||
<img src="pro_form.png"> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_spaced"> |
|||
<h3 class="oe_slogan">Only assignee & Assigned Person will Follow the Task By Default</h3> |
|||
<div class="oe_demo oe_picture oe_screenshot" style="max-height: 100%;"> |
|||
<img src="task_form.png"> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
|
|||
|
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 61 KiB |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record model="ir.ui.view" id="project_task_follower_form_view"> |
|||
<field name="name">project.project.form</field> |
|||
<field name="model">project.project</field> |
|||
<field name="inherit_id" ref="project.edit_project"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="user_id" position="after"> |
|||
<field name="restrict_automatic_task_follow" /> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
Loading…
Reference in new issue