Skip to content

[16.0][FIX] account_credit_control: translate credit line table in emails - #571

Open
astirpe wants to merge 1 commit into
OCA:16.0from
astirpe:16_fix_account_credit_control
Open

[16.0][FIX] account_credit_control: translate credit line table in emails#571
astirpe wants to merge 1 commit into
OCA:16.0from
astirpe:16_fix_account_credit_control

Conversation

@astirpe

@astirpe astirpe commented Jul 24, 2026

Copy link
Copy Markdown
Member

Current behavior:
When generating credit control emails with the mail_show_invoice_detail option enabled, the injected HTML table containing the invoice details ("Invoices summary", "Due date", etc.) is rendered in the language of the user triggering the action (or the cron user). It ignores the partner's configured language.

Expected behavior:
The injected table's headers, date formats, and currency formats should seamlessly match the language of the recipient, aligning with how the rest of the mail.template is translated.

Proposed changes:

  • Updated _get_credit_control_communication_table in credit.control.communication to force the environment context to match contact_address_id.lang (falling back to en_US) before evaluating the _("...") gettext aliases and format helpers.
  • This mimics the exact logic used in the lang field of the credit control mail templates.
  • Added test coverage in test_credit_control_communication_translation.py to ensure the context propagation successfully translates the standard table headers.

@OCA-git-bot OCA-git-bot added mod:account_credit_control Module account_credit_control series:16.0 labels Jul 24, 2026
@astirpe
astirpe marked this pull request as ready for review July 24, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_credit_control Module account_credit_control series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants