From 23dc232d59af994e8dc63c7437e916d98c6a6f99 Mon Sep 17 00:00:00 2001 From: ced <> Date: Wed, 16 May 2007 06:43:35 +0000 Subject: [PATCH] ACCOUNT: fix search debit/credit on partner bzr revid: ced-ee96c65669ed7b1304fe059e1799df0b08cfc4d1 --- addons/account/partner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/partner.py b/addons/account/partner.py index 0c0bb36e3a1..2dda66d95cb 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -65,7 +65,7 @@ class res_partner(osv.osv): if not len(args): return [] where = ' and '.join(map(lambda x: '(sum(debit-credit)'+x[1]+str(x[2])+')',args)) - cr.execute('select partner_id from account_move_line where account_id in (select id from account_account where type=%s) and reconcile_id is null and state<>\'draft\' group by partner_id having '+where, ('receivable',) ) + cr.execute('select partner_id from account_move_line where account_id in (select id from account_account where type=%s) and reconcile_id is null and state<>\'draft\' and partner_id is not null group by partner_id having '+where, ('receivable',) ) res = cr.fetchall() if not len(res): return [('id','=','0')] @@ -75,7 +75,7 @@ class res_partner(osv.osv): if not len(args): return [] where = ' and '.join(map(lambda x: '(sum(debit-credit)'+x[1]+str(x[2])+')',args)) - cr.execute('select partner_id from account_move_line where account_id in (select id from account_account where type=%s) and reconcile_id is null and state<>\'draft\' group by partner_id having '+where, ('payable',) ) + cr.execute('select partner_id from account_move_line where account_id in (select id from account_account where type=%s) and reconcile_id is null and state<>\'draft\'and partner_id is not null group by partner_id having '+where, ('payable',) ) res = cr.fetchall() if not len(res): return [('id','=','0')]