[FIX] web: force formatType for float_time after instanciation

Since in hr_timesheet, we are binding 'timesheet_uom' widget
on existing one (and it might change according to the session
info), we came to the case a formatType is different from the
one of the widget in the registry. Then, the AbstractField
fallbacks on the field type as formatter. Example;
timesheet_uom widget is blind on float_time, but their keys
are differents in field registry, so the formatter will be
'float' and not 'float_time'.

This commit override the formatType determined by the
AbstractField for the float_time widget.
This commit is contained in:
jem-odoo
2018-08-24 15:48:26 +02:00
parent 10c9f07286
commit 0c482b07b6
@@ -896,6 +896,11 @@ var FieldFloatTime = FieldFloat.extend({
// 'float_time', but for the sake of clarity, we explicitely define a
// FieldFloatTime widget with formatType = 'float_time'.
formatType: 'float_time',
init: function () {
this._super.apply(this, arguments);
this.formatType = 'float_time';
}
});
var FieldFloatFactor = FieldFloat.extend({