Skip to content

Commit 7b4e005

Browse files
committed
[FIX] account: Create reversal reference using partner's language
Steps to reproduce: ==================== - Create an invoice - Add a customer whose language differs from the user's language - Create a reversal - Print the PDF Problem: ========= The reversal reference is generated using the user's language, making it impossible to translate properly because the string value is changed and concatenated with the invoice name. Solution: ========== Generate the reversal reference using the partner's language to enable proper translation. opw-4743430 closes odoo#216458 X-original-commit: 3b65dd9 Signed-off-by: Antoine Boonen (aboo) <[email protected]> Signed-off-by: Saif Allah Ben Khalil (sben) <[email protected]>
1 parent db00a84 commit 7b4e005

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

addons/account/wizard/account_move_reversal.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ def _compute_from_moves(self):
9090
def _prepare_default_reversal(self, move):
9191
reverse_date = self.date
9292
mixed_payment_term = move.invoice_payment_term_id.id if move.invoice_payment_term_id.early_pay_discount_computation == 'mixed' else None
93+
lang = move.partner_id.lang or self.env.lang
9394
return {
94-
'ref': _('Reversal of: %(move_name)s, %(reason)s', move_name=move.name, reason=self.reason)
95+
'ref': self.with_context(lang=lang).env._('Reversal of: %(move_name)s, %(reason)s', move_name=move.name, reason=self.reason)
9596
if self.reason
96-
else _('Reversal of: %s', move.name),
97+
else self.with_context(lang=lang).env._('Reversal of: %s', move.name),
9798
'date': reverse_date,
9899
'invoice_date_due': reverse_date,
99100
'invoice_date': move.is_invoice(include_receipts=True) and (self.date or move.date) or False,

0 commit comments

Comments
 (0)