| 1 |
import { useService } from "@web/core/utils/hooks"; |
| 2 |
import { registry } from "@web/core/registry"; |
| 3 |
import { FloatFactorField } from "@web/views/fields/float_factor/float_factor_field"; |
| 4 |
import { FloatToggleField } from "@web/views/fields/float_toggle/float_toggle_field"; |
| 5 |
import { FloatTimeField } from "@web/views/fields/float_time/float_time_field"; |
| 6 |
import { standardFieldProps } from "@web/views/fields/standard_field_props"; |
| 7 |
|
| 8 |
import { Component } from "@odoo/owl"; |
| 9 |
|
| 10 |
export class TimesheetUOM extends Component { |
| 11 |
static props = { |
| 12 |
...standardFieldProps, |
| 13 |
}; |
| 14 |
|
| 15 |
static template = "hr_timesheet.TimesheetUOM"; |
| 16 |
|
| 17 |
static components = { FloatFactorField, FloatToggleField, FloatTimeField }; |
| 18 |
|
| 19 |
setup() { |
| 20 |
this.timesheetUOMService = useService("timesheet_uom"); |
| 21 |
} |
| 22 |
|
| 23 |
get timesheetComponent() { |
| 24 |
return this.timesheetUOMService.getTimesheetComponent(); |
| 25 |
} |
| 26 |
|
| 27 |
get timesheetComponentProps() { |
| 28 |
return this.timesheetUOMService.getTimesheetComponentProps(this.props); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
export const timesheetUOM = { |
| 33 |
component: TimesheetUOM, |
| 34 |
}; |
| 35 |
|
| 36 |
registry.category("fields").add("timesheet_uom", timesheetUOM); |