summaryrefslogtreecommitdiff
path: root/addons/hr_timesheet/static/src/js/timesheet_factor.js
blob: def165e03fd84b3f96f6529da07ddcb072e53ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
};

});