From d0efae47b508609553ad82b39be9aca558958342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 14 Oct 2024 14:37:41 +0200 Subject: [PATCH] Enforce positive number of digits for currency --- modules/currency/currency.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/currency/currency.py b/modules/currency/currency.py index 7418c31293..04b8414a5f 100644 --- a/modules/currency/currency.py +++ b/modules/currency/currency.py @@ -61,6 +61,9 @@ class Currency( ], help="The minimum amount which can be represented in this currency.") digits = fields.Integer("Digits", required=True, + domain=[ + ('digits', '>=', 0), + ], help="The number of digits to display after the decimal separator.") @classmethod