[IMP] web: format float_time on field blur
Before this commit: when float_time field value changed and field is blurred, it does not format value and it formats value only when saving record, this looks awkward and buggy. After this commit: when float_time field value changed and blurred, value will be formatted. task-2518730 closes odoo/odoo#70481 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
committed by
Aaron Bohy
parent
b93517b7eb
commit
ed77ecd87b
@@ -1255,7 +1255,26 @@ var FieldFloatTime = FieldFloat.extend({
|
||||
init: function () {
|
||||
this._super.apply(this, arguments);
|
||||
this.formatType = 'float_time';
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Ensure the widget is re-rendered after being edited s.t. the value is
|
||||
* directly formatted (without waiting for the record to be saved, as we do
|
||||
* by default).
|
||||
*
|
||||
* See InputField@reset: we skip the call to _render if this widget initiated
|
||||
* the change.
|
||||
*
|
||||
* Note: the default behavior could be changed s.t. all fields are formatted
|
||||
* directly on blur.
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
async reset() {
|
||||
await this._super(...arguments);
|
||||
if (!this.isDirty) {
|
||||
await this._render();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
var FieldFloatFactor = FieldFloat.extend({
|
||||
|
||||
Reference in New Issue
Block a user