Skip to content
Snippets Groups Projects
Commit 6964e0c6 authored by Xavier BOL (xbo)'s avatar Xavier BOL (xbo)
Browse files

[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: default avatarLaurent Stukkens (ltu) <ltu@odoo.com>
parent 45ec5871
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment