From 367f018f17d73dbc677aa676024d8296d1f5aa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 21 Apr 2017 10:20:50 +0200 Subject: [PATCH] Allow None as quantity in the input/output domain Because the domain is evaluated by the client when creating a new record, it should be valid with the default value otherwise the focus is put automatically to the invalid field. So the quantity domain must allow None as value to not get the focus. issue6422 review37321002 --- bom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bom.py b/bom.py index 73c384d7b7..db5c771c3f 100644 --- a/bom.py +++ b/bom.py @@ -69,7 +69,10 @@ class BOMInput(ModelSQL, ModelView): unit_digits = fields.Function(fields.Integer('Unit Digits'), 'on_change_with_unit_digits') quantity = fields.Float('Quantity', required=True, - domain=[('quantity', '>=', 0)], + domain=['OR', + ('quantity', '>=', 0), + ('quantity', '=', None), + ], digits=(16, Eval('unit_digits', 2)), depends=['unit_digits'])