From 4021ab37849b452b41d18b50f33089101c4ce558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 2 Dec 2011 11:43:40 +0100 Subject: [PATCH] Set fallback value of tdp to 0 for number fields issue2299 review191002 --- tryton/common/tdp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tryton/common/tdp.py b/tryton/common/tdp.py index 898965052e..9b7f372bd1 100644 --- a/tryton/common/tdp.py +++ b/tryton/common/tdp.py @@ -51,17 +51,17 @@ def cast(field, value): return conv(value) except ValueError: continue - return False + return 0 elif type_ == 'float': try: return float(value) except ValueError: - return False + return 0.0 elif type_ == 'numeric': try: return Decimal(value) except decimal.InvalidOperation: - return False + return Decimal(0) elif type_ in ('selection', 'reference'): for key, text in field['selection']: if text == value: