details: https://code.tryton.org/tryton/commit/5f2995a96608
branch: default
user: Cédric Krier <[email protected]>
date: Wed Mar 11 19:04:22 2026 +0100
description:
Forbid the payment of an amount of 0 when the amount is editable
Closes #14670
diffstat:
modules/account_payment/payment.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (19 lines):
diff -r 0e3f9c26b751 -r 5f2995a96608 modules/account_payment/payment.py
--- a/modules/account_payment/payment.py Wed Mar 11 10:01:51 2026 +0100
+++ b/modules/account_payment/payment.py Wed Mar 11 19:04:22 2026 +0100
@@ -303,7 +303,14 @@
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',