From 3b292c46b71ec73dd5b8ffd2ad03009a441cd2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 11 Mar 2026 19:04:22 +0100 Subject: [PATCH] Forbid the payment of an amount of 0 when the amount is editable Closes #14670 --- modules/account_payment/payment.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/account_payment/payment.py b/modules/account_payment/payment.py index 2577397639..250a0f9b9b 100644 --- a/modules/account_payment/payment.py +++ b/modules/account_payment/payment.py @@ -303,7 +303,14 @@ class Payment(Workflow, ModelSQL, ModelView, ChatMixin): date = fields.Date('Date', required=True, states=_STATES) amount = Monetary( "Amount", currency='currency', digits='currency', required=True, - domain=[('amount', '>=', 0)], + domain=[ + If(Eval('state').in_( + If(Eval('process_method') == 'manual', + ['draft', 'processing'], + ['draft'])), + ('amount', '>', 0), + ('amount', '>=', 0)), + ], states={ 'readonly': ~Eval('state').in_( If(Eval('process_method') == 'manual',