summaryrefslogtreecommitdiff
path: root/addons/hr_timesheet/static/src/js/timesheet_factor.js
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_timesheet/static/src/js/timesheet_factor.js
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/hr_timesheet/static/src/js/timesheet_factor.js')
-rw-r--r--addons/hr_timesheet/static/src/js/timesheet_factor.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/hr_timesheet/static/src/js/timesheet_factor.js b/addons/hr_timesheet/static/src/js/timesheet_factor.js
new file mode 100644
index 00000000..def165e0
--- /dev/null
+++ b/addons/hr_timesheet/static/src/js/timesheet_factor.js
@@ -0,0 +1,20 @@
+odoo.define('hr_timesheet.timesheet_factor', function (require) {
+'use strict';
+
+const timesheetUomFields = require('hr_timesheet.timesheet_uom');
+const fieldUtils = require('web.field_utils');
+const fieldRegistry = require('web.field_registry');
+
+fieldRegistry.add('timesheet_factor', timesheetUomFields.FieldTimesheetFactor);
+
+fieldUtils.format.timesheet_factor = function(value, field, options) {
+ const formatter = fieldUtils.format[timesheetUomFields.FieldTimesheetFactor.prototype.formatType];
+ return formatter(value, field, options);
+};
+
+fieldUtils.parse.timesheet_factor = function(value, field, options) {
+ const parser = fieldUtils.parse[timesheetUomFields.FieldTimesheetFactor.prototype.formatType];
+ return parser(value, field, options);
+};
+
+});