[FIX] web: digits precision
- Remove unnecessary "round_decimals". Will be process by format_value - Fix json format value for digits attribute
This commit is contained in:
committed by
Aaron Bohy
parent
dbc6f21321
commit
eed432519e
@@ -217,7 +217,7 @@
|
||||
<group name="weight" string="Weights">
|
||||
<label for="volume"/>
|
||||
<div class="o_row">
|
||||
<field digits="(14, 3)" name="volume"/>
|
||||
<field digits="[14, 3]" name="volume"/>
|
||||
<span>m³</span>
|
||||
</div>
|
||||
<label for="weight"/>
|
||||
|
||||
@@ -562,8 +562,6 @@ var FieldFloat = InputField.extend({
|
||||
this._super.apply(this, arguments);
|
||||
if (this.attrs.digits) {
|
||||
this.nodeOptions.digits = JSON.parse(this.attrs.digits);
|
||||
} else {
|
||||
this.nodeOptions.digits = this.field.digits;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -591,11 +589,8 @@ var FieldFloat = InputField.extend({
|
||||
* @private
|
||||
*/
|
||||
_renderReadonly: function () {
|
||||
var value = this.value;
|
||||
if (this.nodeOptions.digits && this.nodeOptions.digits.length === 2) {
|
||||
value = utils.round_decimals(value, this.nodeOptions.digits[1]);
|
||||
}
|
||||
var $span = $('<span>').addClass('o_form_field o_form_field_number').text(this._formatValue(value));
|
||||
var value = this._formatValue(this.value);
|
||||
var $span = $('<span>').addClass('o_form_field o_form_field_number').text(value);
|
||||
this.$el.html($span);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user