ACCOUNT: fix search debit/credit on partner

bzr revid: ced-ee96c65669ed7b1304fe059e1799df0b08cfc4d1
This commit is contained in:
ced 2007-05-16 06:43:35 +00:00
parent 08f6c55e83
commit 23dc232d59
1 changed files with 2 additions and 2 deletions

View File

@ -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')]