Your company uses Odoo >= v14 to manage timesheet and has a default setting to timesheet in Days?
By default, the only values you can select are:
- 0.0
- 0.5
- 1.0
Fortunately, the widget supports customization!
In the view definition, you can add an option to define a new range usable for the widget for this view. With the following code, you will be able to select any tenth of a day:
options="{'range':[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}"
Demonstration:
In the tree view of the timesheets, change the definition of the field unit_amount
by:
<field name="unit_amount" optional="show" widget="timesheet_uom" sum="Total" decoration-danger="unit_amount > 24" options="{'range':[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}" />
And here is the result:
Top comments (2)
good , i will use it right now , thank you!
Good read , we provide Odoo integration services : ajackus.com/partner-platforms/odoo