Skip to content

Commit a8f439b

Browse files
committed
[IMP] Post mail body in chatter instead of the link to the mail
1 parent 2ba8861 commit a8f439b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from collections import defaultdict
88

99
from dateutil.relativedelta import relativedelta
10+
from markupsafe import Markup
1011

1112
from odoo import _, api, fields, models, tools
1213
from odoo.exceptions import UserError
@@ -634,6 +635,30 @@ def _prepare_overdue_reminder_action(self, vals):
634635
if self.reminder_type != "phone":
635636
rvals["counter"] = inv.overdue_reminder_counter + 1
636637
vals["reminder_ids"].append((0, 0, rvals))
638+
if self.reminder_type == "mail":
639+
inv.message_post(
640+
body=Markup(
641+
_(
642+
"<strong>Overdue reminder</strong> sent by mail: "
643+
"%(mail_body)s",
644+
mail_body=str(self.mail_body),
645+
)
646+
)
647+
)
648+
elif self.reminder_type == "phone":
649+
inv.message_post(
650+
body=Markup(
651+
_(
652+
"<strong>Overdue reminder</strong> by phone. "
653+
"Result/Info: %(result)s.",
654+
result=self.result_id.name,
655+
)
656+
)
657+
)
658+
elif self.reminder_type == "post":
659+
inv.message_post(
660+
body=Markup(_("<strong>Overdue reminder</strong> sent by post."))
661+
)
637662

638663
def print_letter(self):
639664
self.check_warnings()

0 commit comments

Comments
 (0)