Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FW][FIX] mail_show_follower: Use company from the document to render messages correctly + proper lang handle #1486

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions mail_show_follower/models/mail_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ def _send(self, auto_commit=False, raise_exception=False, smtp_session=None):
show_in_cc_recipients = recipients._filter_shown_in_cc(show_internal_users)
if len(show_in_cc_recipients) <= 1:
continue

langs = (
mail.notification_ids.res_partner_id.mapped("lang")
lang = (
mail.notification_ids.res_partner_id[:1].lang
or mail.author_id.lang
or company.partner_id.lang
or "en_US"
)
final_cc = mail.with_context(lang=langs[0])._build_cc_text(
show_in_cc_recipients
final_cc = (
mail.with_context(lang=lang)
.with_company(company)
._build_cc_text(show_in_cc_recipients)
)
mail.body_html = final_cc + mail.body_html

Expand Down
Loading