diff --git a/addons/l10n_fr_fec/wizard/account_fr_fec.py b/addons/l10n_fr_fec/wizard/account_fr_fec.py index 1feeba79a87..76612c9532d 100644 --- a/addons/l10n_fr_fec/wizard/account_fr_fec.py +++ b/addons/l10n_fr_fec/wizard/account_fr_fec.py @@ -198,17 +198,18 @@ class AccountFrFec(models.TransientModel): AND am.date < %(date_from)s AND aa.include_initial_balance = 't' GROUP BY aml.account_id, aa.account_type - HAVING aa.account_type not in ('asset_receivable', 'liability_payable') + HAVING aa.account_type not in ('asset_receivable', 'liability_payable') AND round(sum(aml.balance), %(currency_digits)s) != 0 ''' + currency_digits = 2 params = { **where_params, 'formatted_date_year': self.date_from.year, 'formatted_date_from': fields.Date.to_string(self.date_from).replace('-', ''), 'date_from': self.date_from, + 'currency_digits': currency_digits, } self._cr.execute(sql_query, params) - currency_digits = 2 for row in self._cr.fetchall(): listrow = list(row) account_id = listrow.pop() @@ -287,7 +288,7 @@ class AccountFrFec(models.TransientModel): AND am.date < %(date_from)s AND aa.include_initial_balance = 't' GROUP BY aml.account_id, aa.account_type, rp.ref, rp.id - HAVING aa.account_type in ('asset_receivable', 'liability_payable') + HAVING aa.account_type in ('asset_receivable', 'liability_payable') AND round(sum(aml.balance), %(currency_digits)s) != 0 ''' self._cr.execute(sql_query, params)