-
- Downloads
[FIX] hr_timesheet: ensure UoM is defined on timesheets
Before this commit, if the user uses Studio app to customize the form
view of timesheet and adds `product_uom_id` field in that view, then if
for instance that field is invisible, it will be in in the vals when the
user will create a timesheet. In that case, the value given to that
field will be False since the field has no default value. Since in the
compute of `total_timesheet_time` defined in project used that field to
convert the `unit_amount` of each timesheet linked to this project in
the right UoM, the `product_uom_id` field has to be defined if the AAL
is a timesheet, otherwise, the timesheets without any UoM set on
`product_uom_id` will be excluded in the compute.
This commit fixes the issue by setting a UoM if the UoM is not in vals
or if the value is False for a timesheet.
opw-2884148
closes odoo/odoo#94162
Signed-off-by:
Laurent Stukkens (ltu) <ltu@odoo.com>
Loading
Please register or sign in to comment