From 42e9502ffccfabb269409207dc079c1acb46bba7 Mon Sep 17 00:00:00 2001 From: "Nicolas (vin)" Date: Tue, 2 Aug 2022 07:49:18 +0000 Subject: [PATCH] [FIX] account: improve demo data Improve the demo data for bank statement in account by formatting the payment_ref amounts using the company currency, and fixing the due amount in one payment_ref to match the statement line amount. Task id #2855485 closes odoo/odoo#98510 X-original-commit: 4b23d11184be9bac5ef9790cc7f38bc4d637b47a Signed-off-by: Laurent Smet Signed-off-by: Nicolas Viseur --- addons/account/demo/account_demo.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/account/demo/account_demo.py b/addons/account/demo/account_demo.py index b53a311b5ac..a795d19d2fc 100644 --- a/addons/account/demo/account_demo.py +++ b/addons/account/demo/account_demo.py @@ -6,7 +6,7 @@ from dateutil.relativedelta import relativedelta from odoo import api, fields, models, Command from odoo.exceptions import UserError, ValidationError -from odoo.tools.misc import file_open +from odoo.tools.misc import file_open, formatLang _logger = logging.getLogger(__name__) @@ -132,7 +132,7 @@ class AccountChartTemplate(models.Model): 'partner_id': ref('base.res_partner_12').id }), Command.create({ - 'payment_ref': time.strftime('First 2000 $ of invoice %Y/00001'), + 'payment_ref': time.strftime(f'First {formatLang(self.env, 2000, currency_obj=self.env.company.currency_id)} of invoice %Y/00001'), 'amount': 2000, 'date': time.strftime('%Y-01-01'), 'partner_id': ref('base.res_partner_12').id @@ -149,10 +149,9 @@ class AccountChartTemplate(models.Model): 'partner_id': ref('base.res_partner_2').id }), Command.create({ - 'payment_ref': 'R:9772938 10/07 AX 9415116318 T:5 BRT: 100,00€ C/ croip', + 'payment_ref': f'R:9772938 10/07 AX 9415116318 T:5 BRT: {formatLang(self.env, 96.67, currency_obj=self.env.company.currency_id)} C/ croip', 'amount': 96.67, 'date': time.strftime('%Y-01-01'), - 'partner_id': ref('base.res_partner_2').id }), ] },