From 8f92935054087c02b00df0864599fa7d4d09fac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 4 Aug 2023 23:32:33 +0200 Subject: [PATCH] Limit account on payment to receivable or payable It is the same constraint as for the line. --- modules/account_payment_clearing/CHANGELOG | 1 + modules/account_payment_clearing/payment.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/account_payment_clearing/CHANGELOG b/modules/account_payment_clearing/CHANGELOG index 115adaedf2..38a24df697 100644 --- a/modules/account_payment_clearing/CHANGELOG +++ b/modules/account_payment_clearing/CHANGELOG @@ -1,3 +1,4 @@ +* Limit account on payment to receivable or payable Version 6.8.0 - 2023-05-01 -------------------------- diff --git a/modules/account_payment_clearing/payment.py b/modules/account_payment_clearing/payment.py index d1db8e728b..b1c813cf91 100644 --- a/modules/account_payment_clearing/payment.py +++ b/modules/account_payment_clearing/payment.py @@ -116,7 +116,10 @@ class Payment(metaclass=PoolMeta): domain=[ ('closed', '!=', True), ('company', '=', Eval('company', -1)), - ('type.statement', 'in', ['balance', 'off-balance']), + If(Eval('kind') == 'receivable', + ('type.receivable', '=', True), + ('type.payable', '=', True), + ), ['OR', ('second_currency', '=', Eval('currency', None)), [