From df28690c041a9efd87da7d2498f605deaaacd7e3 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 12 Sep 2019 13:34:29 +0000 Subject: [PATCH] [FIX] account: Maturity date in reconciliation widget Steps to reproduce the bug: - Change the date format of your current lang - Reconcile a statement Bug: The maturity date displayed in the widget didn't use the format of your current lang. opw:2068241 closes odoo/odoo#36944 X-original-commit: d2ad3d6542bfe1c900720148f22abe4b507e2a41 Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/reconciliation_widget.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/account/models/reconciliation_widget.py b/addons/account/models/reconciliation_widget.py index 3d2edd4d224..8bcd22ab50d 100644 --- a/addons/account/models/reconciliation_widget.py +++ b/addons/account/models/reconciliation_widget.py @@ -4,6 +4,7 @@ from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.osv import expression from odoo.tools.misc import formatLang +from odoo.tools import misc class AccountReconciliation(models.AbstractModel): @@ -585,6 +586,8 @@ class AccountReconciliation(models.AbstractModel): for line in move_lines: company_currency = line.company_id.currency_id line_currency = (line.currency_id and line.amount_currency) and line.currency_id or company_currency + date_maturity = misc.format_date(self.env, line.date_maturity, lang_code=self.env.user.lang) + ret_line = { 'id': line.id, 'name': line.name and line.name != '/' and line.move_id.name + ': ' + line.name or line.move_id.name, @@ -596,7 +599,7 @@ class AccountReconciliation(models.AbstractModel): 'account_code': line.account_id.code, 'account_name': line.account_id.name, 'account_type': line.account_id.internal_type, - 'date_maturity': line.date_maturity, + 'date_maturity': date_maturity, 'date': line.date, 'journal_id': [line.journal_id.id, line.journal_id.display_name], 'partner_id': line.partner_id.id, @@ -686,13 +689,14 @@ class AccountReconciliation(models.AbstractModel): amount_currency = amount amount_currency_str = "" amount_str = formatLang(self.env, abs(amount), currency_obj=st_line.currency_id or statement_currency) + date = misc.format_date(self.env, st_line.date, lang_code=self.env.user.lang) data = { 'id': st_line.id, 'ref': st_line.ref, 'note': st_line.note or "", 'name': st_line.name, - 'date': st_line.date, + 'date': date, 'amount': amount, 'amount_str': amount_str, # Amount in the statement line currency 'currency_id': st_line.currency_id.id or statement_currency.id,