Commit 85442ca8 authored by Cédric Krier's avatar Cédric Krier
Browse files

Convert empty value as null instead of 0 in Dict numeric fields

Closes #12038
parent ecf3f470e900
Pipeline #61738 passed with stages
in 6 minutes and 49 seconds
......@@ -5192,7 +5192,11 @@
}
},
get_value: function() {
var value = Number(this.input.val());
var value = this.input.val();
if (!value && (value !== 0)) {
return null;
}
value = Number(value);
if (isNaN(value)) {
return null;
}
......@@ -5215,7 +5219,11 @@
Sao.View.Form.Dict.Numeric = Sao.class_(Sao.View.Form.Dict.Float, {
class_: 'dict-numeric',
get_value: function() {
var value = new Sao.Decimal(this.input.val());
var value = this.input.val();
if (!value && (value !== 0)) {
return null;
}
value = new Sao.Decimal(value);
if (isNaN(value.valueOf())) {
return null;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment