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
This commit is contained in:
Cédric Krier committed 2017-04-21 10:20:50 +02:00
1 parent a7b70342d1
commit 367f018f17
1 file changed
+4 -1
+4 -1
View File
@@ -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'])