summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorjem-odoo <jem@openerp.com>2018-08-24 11:53:51 +0200
committerjem-odoo <jem@openerp.com>2018-08-24 15:48:26 +0200
commit0c482b07b6d18a965356fc38203ef9d2a0ed62f5 (patch)
tree519309f64b1640394ca48408c474d49118145929 /addons/web/static/src
parent10c9f07286d497f2a8c0602a90d00a18ce110179 (diff)
[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.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js5
1 files changed, 5 insertions, 0 deletions
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({