summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-25 09:27:23 +0000
committerChristophe Simonis <chs@odoo.com>2019-06-25 09:36:12 +0000
commite628e662719c19c7a9e1b95ffae72d74565dcdee (patch)
treef2aae4db7149c0bc77ff3b90910abf71dedc3ecc /addons
parent89d5cc3b3db9e86adebb28d45a03fa64baaefc36 (diff)
[FIX] hr_timesheet: add missing dependency for `timesheet_uom` widget
The `timesheet_uom` widget is a proxy to another widget (configurable server-side). We need to ensure the widget registry is filled before using it to avoid a fallback to `float_factor` widget. closes odoo/odoo#34350 Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/hr_timesheet/static/src/js/timesheet_uom.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/hr_timesheet/static/src/js/timesheet_uom.js b/addons/hr_timesheet/static/src/js/timesheet_uom.js
index 503b923488c..345012d80e5 100644
--- a/addons/hr_timesheet/static/src/js/timesheet_uom.js
+++ b/addons/hr_timesheet/static/src/js/timesheet_uom.js
@@ -6,6 +6,7 @@ var basicFields = require('web.basic_fields');
var fieldUtils = require('web.field_utils');
var fieldRegistry = require('web.field_registry');
+var _registry = require('web._field_registry'); // wait registry to be filled...
var session = require('web.session');
/**
@@ -75,7 +76,6 @@ var FieldTimesheetToggle = basicFields.FieldFloatToggle.extend({
* implementation (float_time, float_toggle, ...). The default
* value will be 'float_factor'.
**/
-var FieldTimesheetUom = FieldTimesheetFactor;
var widgetName = 'timesheet_uom' in session ?
session.timesheet_uom.timesheet_widget : 'float_factor';
var FieldTimesheetUom = widgetName === 'float_toggle' ?
@@ -90,7 +90,7 @@ var _tweak_options = function(options) {
options.factor = session.timesheet_uom_factor;
}
return options;
-}
+};
fieldUtils.format.timesheet_uom = function(value, field, options) {
options = _tweak_options(options || {});
@@ -106,4 +106,3 @@ fieldUtils.parse.timesheet_uom = function(value, field, options) {
return FieldTimesheetUom;
});
-