[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 <las@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
This commit is contained in:
Nicolas (vin)
2022-08-22 08:57:47 +02:00
parent c6a4332cf2
commit 42e9502ffc
+3 -4
View File
@@ -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
}),
]
},