Browse Source

Merge 22b0e4bd9b into fda204e80f

pull/292/merge
Carlos Almeida 5 years ago
committed by GitHub
parent
commit
c247788ede
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      web_mail_no_followers/README.rst
  2. 24
      web_mail_no_followers/__init__.py
  3. 34
      web_mail_no_followers/__openerp__.py
  4. 16
      web_mail_no_followers/i18n/web_fetchmail_no_followers.pot
  5. 24
      web_mail_no_followers/model/__init__.py
  6. 61
      web_mail_no_followers/model/mail_thread.py
  7. BIN
      web_mail_no_followers/static/description/icon.png

4
web_mail_no_followers/README.rst

@ -0,0 +1,4 @@
Description
-----------
Don't add email authors as followers when
receiving a message on any object.

24
web_mail_no_followers/__init__.py

@ -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

34
web_mail_no_followers/__openerp__.py

@ -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': [],
}

16
web_mail_no_followers/i18n/web_fetchmail_no_followers.pot

@ -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"

24
web_mail_no_followers/model/__init__.py

@ -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

61
web_mail_no_followers/model/mail_thread.py

@ -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

BIN
web_mail_no_followers/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

Loading…
Cancel
Save