[FIX] sale: cannot filter on paid = False

This commit is contained in:
Anaël Closson 2014-06-03 16:19:05 +02:00
parent faace8493d
commit 271885716f
1 changed files with 6 additions and 7 deletions

View File

@ -128,8 +128,7 @@ class sale_order(osv.osv):
sale_clause = ''
no_invoiced = False
for arg in args:
if arg[1] == '=':
if arg[2]:
if (arg[1] == '=' and arg[2]) or (arg[1] == '!=' and not arg[2]):
clause += 'AND inv.state = \'paid\''
else:
clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id '