Carlos Almeida
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 163 additions and 0 deletions
-
4web_mail_no_followers/README.rst
-
24web_mail_no_followers/__init__.py
-
34web_mail_no_followers/__openerp__.py
-
16web_mail_no_followers/i18n/web_fetchmail_no_followers.pot
-
24web_mail_no_followers/model/__init__.py
-
61web_mail_no_followers/model/mail_thread.py
-
BINweb_mail_no_followers/static/description/icon.png
@ -0,0 +1,4 @@ |
|||
Description |
|||
----------- |
|||
Don't add email authors as followers when |
|||
receiving a message on any object. |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). |
|||
# Copyright (C) 2013 ThinkOpen Solutions Brasil (<http://www.tkobr.com>). |
|||
# Author Carlos Almeida <carlos.almeida at tkobr.com> |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from . import model |
@ -0,0 +1,34 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). |
|||
# Copyright (C) 2013 ThinkOpen Solutions Brasil (<http://www.tkobr.com>). |
|||
# Author Carlos Almeida <carlos.almeida at tkobr.com> |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
{ |
|||
'name': 'Do not add followers on sending or receiving mails', |
|||
'version': '8.0.0.1.0', |
|||
'author': "ThinkOpen Solutions Brasil, Odoo Community Association (OCA)", |
|||
'category': 'Web', |
|||
'website': 'http://www.tkobr.com', |
|||
'license': 'AGPL-3', |
|||
'images': [], |
|||
'depends': ['mail'], |
|||
'data': [], |
|||
} |
@ -0,0 +1,16 @@ |
|||
# Translation of OpenERP Server. |
|||
# This file contains the translation of the following modules: |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: OpenERP Server 8.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-01-15 14:24+0000\n" |
|||
"PO-Revision-Date: 2016-01-15 16:24+0100\n" |
|||
"Last-Translator: M\n" |
|||
"Language-Team: \n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: 8bit\n" |
|||
"Plural-Forms: \n" |
|||
|
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). |
|||
# Copyright (C) 2013 ThinkOpen Solutions Brasil (<http://www.tkobr.com>). |
|||
# Author Carlos Almeida <carlos.almeida at tkobr.com> |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from . import mail_thread |
@ -0,0 +1,61 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). |
|||
# Copyright (C) 2013 ThinkOpen Solutions Brasil (<http://www.tkobr.com>). |
|||
# Author Carlos Almeida <carlos.almeida at tkobr.com> |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from openerp.addons.mail.mail_thread import mail_thread |
|||
from openerp import models, api |
|||
|
|||
|
|||
message_post_super = mail_thread.message_post |
|||
|
|||
|
|||
@api.cr_uid_ids_context |
|||
def MailNoFollowersMessageFetch(self, cr, uid, thread_id, body='', |
|||
subject=None, type='notification', |
|||
subtype=None, parent_id=False, |
|||
attachments=None, context=None, |
|||
content_subtype='html', **kwargs): |
|||
|
|||
# add mail_create_nosubscribe to not subscribe any messages for fetchmail |
|||
nosub_ctx = dict(context, mail_create_nosubscribe=True) |
|||
# remove key mail_create_nosubscribe to not subscribe partners on send |
|||
if 'mail_post_autofollow' in nosub_ctx: |
|||
del nosub_ctx['mail_post_autofollow'] |
|||
if 'mail_post_autofollow_partner_ids1' in nosub_ctx: |
|||
del nosub_ctx['mail_post_autofollow_partner_ids'] |
|||
|
|||
thread_id = message_post_super(self, cr, uid, thread_id, body=body, |
|||
subject=subject, type=type, |
|||
subtype=subtype, parent_id=parent_id, |
|||
attachments=attachments, context=nosub_ctx, |
|||
content_subtype=content_subtype, **kwargs) |
|||
return thread_id |
|||
|
|||
|
|||
class MailNoFollowers(models.Model): |
|||
''' I define this class so this code will be executed only if module |
|||
is installed in database. Otherwise it will be always executed. |
|||
''' |
|||
_name = 'mail.thread' |
|||
|
|||
def __init__(self, *arg, **kwargs): |
|||
mail_thread.message_post = MailNoFollowersMessageFetch |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue