[FIX] account: dashboard: fix count of number of items to reconcile

If a bank statement line has a linked account, it will be skipped by the
reconciliation widget and automatically reconciled when the bank
statement is closed. Thus, there is no need to count them in the
accounting dashboard.
This commit is contained in:
eco-odoo
2018-09-21 10:17:01 +02:00
committed by De Paoli Quentin
parent 68715a46d1
commit df01624670
@@ -157,7 +157,7 @@ class account_journal(models.Model):
FROM account_bank_statement_line AS line
LEFT JOIN account_bank_statement AS st
ON line.statement_id = st.id
WHERE st.journal_id IN %s AND st.state = 'open' AND line.amount != 0.0
WHERE st.journal_id IN %s AND st.state = 'open' AND line.amount != 0.0 AND line.account_id IS NULL
AND not exists (select 1 from account_move_line aml where aml.statement_line_id = line.id)
""", (tuple(self.ids),))
number_to_reconcile = self.env.cr.fetchone()[0]