From 8388b12b1e53e641887347630cf0c009dfd1e93b Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 21 Apr 2016 09:16:23 +0200 Subject: [PATCH] [FIX] l10n_fr_fec: fix unwanted NULL values An account.move.line could be not linked to a partner. opw-675586 --- addons/l10n_fr_fec/wizard/fec.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/l10n_fr_fec/wizard/fec.py b/addons/l10n_fr_fec/wizard/fec.py index 5aa6b177415..6ab15ccbd12 100644 --- a/addons/l10n_fr_fec/wizard/fec.py +++ b/addons/l10n_fr_fec/wizard/fec.py @@ -125,11 +125,11 @@ class AccountFrFec(models.TransientModel): aa.code AS CompteNum, replace(aa.name, '|', '/') AS CompteLib, CASE WHEN rp.ref IS null OR rp.ref = '' - THEN 'ID ' || rp.id + THEN COALESCE('ID ' || rp.id, '') ELSE rp.ref END AS CompAuxNum, - replace(rp.name, '|', '/') AS CompAuxLib, + COALESCE(replace(rp.name, '|', '/'), '') AS CompAuxLib, CASE WHEN am.ref IS null OR am.ref = '' THEN '-' ELSE replace(am.ref, '|', '/') @@ -142,7 +142,10 @@ class AccountFrFec(models.TransientModel): CASE WHEN rec.name IS NULL THEN '' ELSE rec.name END AS EcritureLet, CASE WHEN aml.full_reconcile_id IS NULL THEN '' ELSE TO_CHAR(rec.create_date, 'YYYYMMDD') END AS DateLet, TO_CHAR(am.date, 'YYYYMMDD') AS ValidDate, - replace(CASE WHEN aml.amount_currency = 0 THEN '' ELSE to_char(aml.amount_currency, '999999999999999D99') END, '.', ',') AS Montantdevise, + CASE + WHEN aml.amount_currency IS NULL OR aml.amount_currency = 0 THEN '' + ELSE replace(to_char(aml.amount_currency, '999999999999999D99'), '.', ',') + END AS Montantdevise, CASE WHEN aml.currency_id IS NULL THEN '' ELSE rc.name END AS Idevise FROM account_move_line aml