You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
760 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import models, api
  5. class ResPartner(models.Model):
  6. _inherit = 'res.partner'
  7. @api.multi
  8. def _notify(self, message, force_send=False, send_after_commit=True,
  9. user_signature=True):
  10. if self.env.context.get('force_partners_to_notify'):
  11. partners_to_notify =\
  12. self.env.context.get('force_partners_to_notify')
  13. self = self.filtered(lambda p: p.id in partners_to_notify)
  14. super(ResPartner, self)._notify(
  15. message, force_send=force_send,
  16. send_after_commit=send_after_commit, user_signature=user_signature)