mail.notification has been removed. The notify is done directly on the res.partner and channel

This commit is contained in:
Laurent Mignon (ACSONE) 2016-05-25 15:34:16 +02:00 committed by Robin Goots
parent e0cb502584
commit b70d711fb2
3 changed files with 19 additions and 20 deletions

View File

@ -3,4 +3,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import mail_message
from . import mail_notification
from . import res_partner

View File

@ -1,19 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
class MailNotification(models.Model):
_inherit = 'mail.notification'
@api.model
def _notify(self, message_id, partners_to_notify=None,
force_send=False, user_signature=True):
if self.env.context.get('force_partners_to_notify'):
partners_to_notify =\
self.env.context.get('force_partners_to_notify')
super(MailNotification, self)._notify(
message_id, partners_to_notify=partners_to_notify,
force_send=force_send, user_signature=user_signature)

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.multi
def _notify(self, message, force_send=False, user_signature=True):
if self.env.context.get('force_partners_to_notify'):
partners_to_notify =\
self.env.context.get('force_partners_to_notify')
self = self.filtered(lambda p: p.id in partners_to_notify)
super(ResPartner, self)._notify(
message, force_send=False, user_signature=True)