From 0c482b07b6d18a965356fc38203ef9d2a0ed62f5 Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Fri, 24 Aug 2018 11:53:51 +0200 Subject: [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. --- addons/web/static/src/js/fields/basic_fields.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index d56aa02c03d..ed393d667b7 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -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({ -- cgit v1.2.3