[FIX] web: display 0 for FieldFloatToggle

The field was hidden in UI when its value was not set or equal to 0.

Display the field if its value is set to 0.

[IMP] web: clean code
This commit is contained in:
Anh Thao Pham (pta)
2020-07-23 13:54:39 +02:00
parent 61cbee3703
commit cae4ac2381
@@ -1287,7 +1287,14 @@ var FieldFloatToggle = AbstractField.extend({
this._setValue(next_val); // will be parsed in _setValue
}
},
/**
* For float toggle fields, 0 is a valid value.
*
* @override
*/
isSet: function () {
return this.value === 0 || this._super(...arguments);
},
});
var FieldPercentage = FieldFloat.extend({