From 5ddb4863e29adaba635796bed1282f5fc16c1f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 6 Oct 2009 13:36:34 +0200 Subject: [PATCH] Fix quantize of Numeric if value is False --- tryton/gui/window/view_form/model/field.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index 115dd82503..440721113b 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -254,6 +254,8 @@ class NumericField(CharField): digits = model.expr_eval(self.attrs['digits']) else: digits = self.attrs.get('digits', (12, 2)) + if not value: + value = Decimal('0.0') value = value.quantize(Decimal(str(10**-digits[1]))) return super(NumericField, self).set(model, value, modified=modified)