From 81720212e8fa4cc198f81f3662c918fa967eb88e Mon Sep 17 00:00:00 2001 From: smdc-odoo Date: Tue, 5 Jul 2022 07:20:26 +0000 Subject: [PATCH] [FIX] account: fix cutoff percent display Before this commit : When using the cutoff option (e.g. on journal entries), the percentage in the wizard is displayed with 6 digits precision After this commit : The percentage is displayed using only 2 digits precision opw-2896143 closes odoo/odoo#96876 X-original-commit: d71e46dc8369b4d4c929321277a104f6db3fa7a8 Signed-off-by: Laurent Smet --- addons/account/wizard/account_automatic_entry_wizard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/wizard/account_automatic_entry_wizard.py b/addons/account/wizard/account_automatic_entry_wizard.py index faa21a46b57..1b2c6471648 100644 --- a/addons/account/wizard/account_automatic_entry_wizard.py +++ b/addons/account/wizard/account_automatic_entry_wizard.py @@ -225,7 +225,7 @@ class AutomaticEntryWizard(models.TransientModel): 'currency_id': self.journal_id.currency_id.id or self.journal_id.company_id.currency_id.id, 'move_type': 'entry', 'line_ids': [], - 'ref': self._format_strings(_('Adjusting Entry of {date} ({percent:f}% recognized on {new_date})'), grouped_lines[0].move_id, amount), + 'ref': self._format_strings(_('Adjusting Entry of {date} ({percent:.2f}% recognized on {new_date})'), grouped_lines[0].move_id, amount), 'date': fields.Date.to_string(date), 'journal_id': self.journal_id.id, } @@ -347,12 +347,12 @@ class AutomaticEntryWizard(models.TransientModel): accrual_move_offsets[accrual_move] += 2 (accrual_move_lines + destination_move_lines).reconcile() move.message_post(body=self._format_strings(_('Adjusting Entries have been created for this invoice:', + '{percent:.2f}%% of {amount}
  • %(link0)s postponing it to {new_date}
  • ', link0=self._format_move_link(destination_move), link1=self._format_move_link(accrual_move), ), move, amount)) - destination_messages += [self._format_strings(_('Adjusting Entry {link}: {percent:f}% of {amount} recognized from {date}'), move, amount)] - accrual_move_messages[accrual_move] += [self._format_strings(_('Adjusting Entry for {link}: {percent:f}% of {amount} recognized on {new_date}'), move, amount)] + destination_messages += [self._format_strings(_('Adjusting Entry {link}: {percent:.2f}% of {amount} recognized from {date}'), move, amount)] + accrual_move_messages[accrual_move] += [self._format_strings(_('Adjusting Entry for {link}: {percent:.2f}% of {amount} recognized on {new_date}'), move, amount)] destination_move.message_post(body='
    \n'.join(destination_messages)) for accrual_move, messages in accrual_move_messages.items():