Invert sign when searching on deposit amount of party

Since 2cc065fbce6b, the getter is using credit - debit so the searcher should
also.

Closes #13563
This commit is contained in:
Cédric Krier
2024-10-04 09:21:43 +02:00
parent 5d1c35d5f8
commit 660689b128
+2 -1
View File
@@ -97,7 +97,8 @@ class Party(metaclass=PoolMeta):
& line_clause,
group_by=line.party,
having=Operator(
Sum(Coalesce(line.debit, 0) - Coalesce(line.credit, 0)),
# Use credit - debit to positive deposit amount
Sum(Coalesce(line.credit, 0) - Coalesce(line.debit, 0)),
Decimal(clause[2] or 0))))
return [('id', 'in', query)]