@ -41,7 +41,8 @@ class POSOrder(models.Model):
for line in order.account_move.line_id:
if (line.partner_id.id == key[0] and
line.account_id.id == key[1] and
(line.debit > 0) == key[2]):
(line.debit > 0) == key[2] and
line.state == 'valid'):
grouped_data[key].append(line.id)
break
for key, value in grouped_data.iteritems():