From 64106ba7c70283a012d89e423e0c077be09bfbbb Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Thu, 7 Apr 2022 12:38:38 +0000 Subject: [PATCH] [FIX] l10n_fr_fec: use invoice/bill date when generating FEC Install FR accounting and have a FR company setup with VAT Create a bill with bill date different from accounting date Export FEC under Accounting>Reporting>FEC For the created bill the accounting date will be used, while it should be taken first the bill date opw-2680288 closes odoo/odoo#88319 X-original-commit: 2b1fc6a9b48e423e8f299ebeb723c95302aa13ea Signed-off-by: Quentin De Paoli Signed-off-by: Grazioso Andrea (agr) --- addons/l10n_fr_fec/wizard/account_fr_fec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_fr_fec/wizard/account_fr_fec.py b/addons/l10n_fr_fec/wizard/account_fr_fec.py index 561e49fe3d7..fddd90db504 100644 --- a/addons/l10n_fr_fec/wizard/account_fr_fec.py +++ b/addons/l10n_fr_fec/wizard/account_fr_fec.py @@ -327,7 +327,7 @@ class AccountFrFec(models.TransientModel): ELSE REGEXP_REPLACE(replace(am.ref, '|', '/'), '[\\t\\r\\n]', ' ', 'g') END AS PieceRef, - TO_CHAR(am.date, 'YYYYMMDD') AS PieceDate, + TO_CHAR(COALESCE(am.invoice_date, am.date), 'YYYYMMDD') AS PieceDate, CASE WHEN aml.name IS NULL OR aml.name = '' THEN '/' WHEN aml.name SIMILAR TO '[\\t|\\s|\\n]*' THEN '/' ELSE REGEXP_REPLACE(replace(aml.name, '|', '/'), '[\\t\\n\\r]', ' ', 'g') END AS EcritureLib,