2016-05-25 15:34:16 +02:00
|
|
|
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
|
2019-11-29 16:01:16 +01:00
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
2016-05-25 15:34:16 +02:00
|
|
|
|
2019-12-06 11:37:20 +01:00
|
|
|
from odoo import api, models
|
2016-05-25 15:34:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ResPartner(models.Model):
|
2019-12-06 11:37:20 +01:00
|
|
|
_inherit = "res.partner"
|
2016-05-25 15:34:16 +02:00
|
|
|
|
2019-11-29 16:01:16 +01:00
|
|
|
@api.model
|
2019-12-06 11:37:20 +01:00
|
|
|
def _notify(
|
|
|
|
self,
|
|
|
|
message,
|
|
|
|
rdata,
|
|
|
|
record,
|
|
|
|
force_send=False,
|
|
|
|
send_after_commit=True,
|
|
|
|
model_description=False,
|
|
|
|
mail_auto_delete=True,
|
|
|
|
):
|
|
|
|
if self.env.context.get("force_partners_to_notify"):
|
|
|
|
partners_to_notify = self.env.context.get("force_partners_to_notify")
|
2019-11-29 16:01:16 +01:00
|
|
|
record = self.filtered(lambda p: p.id in partners_to_notify)
|
|
|
|
return super()._notify(
|
2019-12-06 11:37:20 +01:00
|
|
|
message,
|
|
|
|
rdata,
|
|
|
|
record,
|
|
|
|
force_send=force_send,
|
|
|
|
send_after_commit=send_after_commit,
|
2019-11-29 16:01:16 +01:00
|
|
|
model_description=model_description,
|
2019-12-06 11:37:20 +01:00
|
|
|
mail_auto_delete=mail_auto_delete,
|
|
|
|
)
|