Debian Codegraph @

addons/hr_timesheet/static/src/components/timesheet_duration_uom/timesheet_duration_uom.js

raw
1 import { registry } from "@web/core/registry";
2 import { TimesheetUOM } from "../timesheet_uom/timesheet_uom";
3 import { TimeHourField } from "../time_hour_field/time_hour_field";
4
5 export class TimesheetDurationUOM extends TimesheetUOM {
6 static components = {
7 ...TimesheetUOM.components,
8 TimeHourField,
9 };
10 get timesheetComponent() {
11 if (this.timesheetUOMService.timesheetWidget === "float_time") {
12 return this.timesheetUOMService.getTimesheetComponent("time_hour_uom");
13 }
14 return super.timesheetComponent;
15 }
16 }
17
18 export const timesheetDurationUOM = {
19 component: TimesheetDurationUOM,
20 };
21
22 registry.category("fields").add("timesheet_duration_uom", timesheetDurationUOM);