-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG]hr_attendance_hour_type_report #203
base: 16.0
Are you sure you want to change the base?
[16.0][MIG]hr_attendance_hour_type_report #203
Conversation
This module provides a new report in hr_attendance to display the worked time of employees split in the following categories: * type of day (weekday, sunday, holiday) * daytime / nighttime The information of a day being a holiday comes from the configured public holidays from the module hr_holidays_public. This is meant as a helper for people interacting with external payroll systems.
Currently translated at 23.0% (6 of 26 strings) Translation: hr-attendance-14.0/hr-attendance-14.0-hr_attendance_hour_type_report Translate-URL: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-14-0-hr_attendance_hour_type_report/fr/
Currently translated at 80.7% (21 of 26 strings) Translation: hr-attendance-14.0/hr-attendance-14.0-hr_attendance_hour_type_report Translate-URL: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-14-0-hr_attendance_hour_type_report/fr/
Currently translated at 100.0% (26 of 26 strings) Translation: hr-attendance-14.0/hr-attendance-14.0-hr_attendance_hour_type_report Translate-URL: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-14-0-hr_attendance_hour_type_report/it/
Currently translated at 100.0% (26 of 26 strings) Translation: hr-attendance-14.0/hr-attendance-14.0-hr_attendance_hour_type_report Translate-URL: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-14-0-hr_attendance_hour_type_report/it/
Currently translated at 15.3% (4 of 26 strings) Translation: hr-attendance-14.0/hr-attendance-14.0-hr_attendance_hour_type_report Translate-URL: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-14-0-hr_attendance_hour_type_report/es/
Currently translated at 100.0% (26 of 26 strings) Translation: hr-attendance-14.0/hr-attendance-14.0-hr_attendance_hour_type_report Translate-URL: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-14-0-hr_attendance_hour_type_report/es/
b45ee85
to
8c48e70
Compare
@adasatorres Good morning, Thank you very much in advance. |
8c48e70
to
0dc9c7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good morning,
I have done a functional review and this LGTM👍. But it should be noted that this error is also found in the version 14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review: LGTM!
This is a dense and impressive addon—congratulations on the effort you've put into it. Timezone manipulation can be a tricky topic, and I really appreciate the way you've handled it here. I've made a few suggestions that might help improve readability and robustness. Feel free to consider them if you find them useful!
TZ = pytz.timezone(rec.employee_id.tz) | ||
tz = rec.employee_id.tz | ||
check_in = rec.check_in | ||
if not check_in.tzinfo: | ||
check_in = TZ.localize(check_in) | ||
check_in_tz = check_in.astimezone(pytz.timezone(tz)) | ||
rec.date = check_in_tz.date() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TZ = pytz.timezone(rec.employee_id.tz) | |
tz = rec.employee_id.tz | |
check_in = rec.check_in | |
if not check_in.tzinfo: | |
check_in = TZ.localize(check_in) | |
check_in_tz = check_in.astimezone(pytz.timezone(tz)) | |
rec.date = check_in_tz.date() | |
tz_code = rec.employee_id.tz | |
TZ = pytz.timezone(tz_code) | |
check_in = rec.check_in | |
if not check_in.tzinfo: | |
check_in = TZ.localize(check_in) | |
check_in_tz = check_in.astimezone(TZ) | |
rec.date = check_in_tz.date() |
Just some refactoring.
night_end = rec.employee_id.company_id.hr_night_work_hour_end | ||
hour_night_end = int(night_end) | ||
minute_night_end = int(60 * (night_end - hour_night_end)) | ||
tz = pytz.timezone(rec.employee_id.tz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same from line 111
<field name="model">hr.attendance</field> | ||
<field name="priority">30</field> | ||
<field name="arch" type="xml"> | ||
<tree export_xlsx="1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<tree export_xlsx="1"> | |
<tree> |
export_xlsx="1" is default behavior
This PR has the |
Good morning, a new feature has been added for migration. It allows overtime hours to be displayed in the report and also enables the weighting of nighttime and overtime hours.
To enable the visibility of overtime hours, you need to activate overtime in the settings. Additionally, there are options in the settings to enable weightings.