From 693ef95e07c93d3c3c67fcdb768da00ce45257e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 4 Oct 2024 09:21:43 +0200 Subject: [PATCH] Invert sign when searching on deposit amount of party Since 2cc065fbce6b, the getter is using credit - debit so the searcher should also. Closes #13563 (grafted from 65325b74728cde5abd1b0fadecb41f6b8a91781d) --HG-- branch : 7.0 --- modules/account_deposit/party.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/account_deposit/party.py b/modules/account_deposit/party.py index 2d0de49148..bcf0b350cd 100644 --- a/modules/account_deposit/party.py +++ b/modules/account_deposit/party.py @@ -96,7 +96,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)]