[FIX] account: fixed the filter used in manual reconciliation process
bzr revid: qdp-launchpad@openerp.com-20130318144342-16w1dreej7yzr51n
This commit is contained in:
commit
2bfbe50079
|
@ -741,20 +741,17 @@ class account_move_line(osv.osv):
|
||||||
|
|
||||||
def list_partners_to_reconcile(self, cr, uid, context=None):
|
def list_partners_to_reconcile(self, cr, uid, context=None):
|
||||||
cr.execute(
|
cr.execute(
|
||||||
"""
|
"""SELECT partner_id FROM (
|
||||||
SELECT partner_id
|
SELECT l.partner_id, p.last_reconciliation_date, SUM(l.debit) AS debit, SUM(l.credit) AS credit, MAX(l.date) AS max_date
|
||||||
FROM (
|
|
||||||
SELECT l.partner_id, p.last_reconciliation_date, SUM(l.debit) AS debit, SUM(l.credit) AS credit
|
|
||||||
FROM account_move_line l
|
FROM account_move_line l
|
||||||
RIGHT JOIN account_account a ON (a.id = l.account_id)
|
RIGHT JOIN account_account a ON (a.id = l.account_id)
|
||||||
RIGHT JOIN res_partner p ON (l.partner_id = p.id)
|
RIGHT JOIN res_partner p ON (l.partner_id = p.id)
|
||||||
WHERE a.reconcile IS TRUE
|
WHERE a.reconcile IS TRUE
|
||||||
AND l.reconcile_id IS NULL
|
AND l.reconcile_id IS NULL
|
||||||
AND (p.last_reconciliation_date IS NULL OR l.date > p.last_reconciliation_date)
|
|
||||||
AND l.state <> 'draft'
|
AND l.state <> 'draft'
|
||||||
GROUP BY l.partner_id, p.last_reconciliation_date
|
GROUP BY l.partner_id, p.last_reconciliation_date
|
||||||
) AS s
|
) AS s
|
||||||
WHERE debit > 0 AND credit > 0
|
WHERE debit > 0 AND credit > 0 AND (last_reconciliation_date IS NULL OR max_date > last_reconciliation_date)
|
||||||
ORDER BY last_reconciliation_date""")
|
ORDER BY last_reconciliation_date""")
|
||||||
ids = cr.fetchall()
|
ids = cr.fetchall()
|
||||||
ids = len(ids) and [x[0] for x in ids] or []
|
ids = len(ids) and [x[0] for x in ids] or []
|
||||||
|
|
Loading…
Reference in New Issue