Skip to content
Snippets Groups Projects
Commit 904edbdb authored by prye-odoo's avatar prye-odoo
Browse files

[FIX] hr_holidays: handle tz attribute error if user timezone empty

When a user tries to create a leave request without linking an employee
with the user and without a configured login user timezone, a traceback
will be generated.

Steps to reproduce:
- Install the "hr_holidays" module.
- Create a new user, e.g., "Test user", and login with another browser.
- Login as an admin user and go to Settings > Users & Companies.
- Search for "Test user" and set Timzone as empty.
- Go to the Time Off menu and create a leave request; after that, a traceback
will be generated.
Error: AttributeError: 'bool' object has no attribute 'upper' 

When a user tries to create a leave request without linking an employee with the
user and without a configured login user timezone, the
_get_start_or_end_from_attendance() function of the "hr.leave" object will call
at that time timzone not getting.
Code reference:
https://github.com/odoo/odoo/blob/15.0/addons/hr_holidays/models/hr_leave.py#L111



Sentry-4441512696

closes odoo/odoo#134208

X-original-commit: 2b0f9e39
Signed-off-by: default avatarSofie Gvaladze (sgv) <sgv@odoo.com>
parent 696cfac2
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment