Skip to content
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

[ADD] hr_attendance_break #142

Open
wants to merge 3 commits into
base: 15.0
Choose a base branch
from
Open

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented Aug 21, 2023

This module lets employees take breaks on the attendance screen:

Screenshot_20230904_171541

This allows them to check in at the beginning of the working day, check out at the end and record breaks in between.

To be sure employees take enough breaks, there's also flagging for employees who didn't take enough breaks.

@hbrunn
Copy link
Member Author

hbrunn commented Aug 21, 2023

@rafaelbn I'm curious what Spanish law says about mandatory work breaks? Plan here is to have the checkout screen scream if you worked longer than is allowed, and offer to adjust the break hours field accordingly.

For what my DE customer needs a minimum length for a break (15min) and a table

Work hours Min break
6 30
9 45

would suffice, meaning if you work 6h or longer, you have to take half an hour break, if you work 9h or longer, you have to take at least three quarters. Would this be general enough to cover ES too?

@albig
Copy link

albig commented Sep 7, 2023

In my setup, ordinary employees cannot access the attendance module with hr_attendance_break installed:

2023-09-07_10-45

Maybe my rights are too strict? The employees should not get the kiosk widget and only have "Manual Attendance" rights.

2023-09-07_10-45_1

@hbrunn
Copy link
Member Author

hbrunn commented Sep 11, 2023

thanks, I keep getting fooled by the demo user which I use for unprivileged tests being actually quite privileged in HR

@albig
Copy link

albig commented Sep 11, 2023

Thank you. Now it works for ordinary employees.

@albig
Copy link

albig commented Sep 14, 2023

Two other issues:

  • if the configured, minimum break length is 00:15, only breaks greater 15 minutes are taken into account and save to break_hours.
  • if the employee has only 20 minutes break, but 30 minutes is the minimum break after 6 hours, the cron adds a break of 10 minutes. This break will not be saved in break_hours.

@hbrunn
Copy link
Member Author

hbrunn commented Sep 18, 2023

  1. my goal here is that only what we can legally count as break ends up in break_hours. How should I handle the minimum break otherwise then?
  2. I see the problem

Should I then keep two fields, break_hours_real and break_hours_legal? Then you can report over both, employees see both and it's transparent where any divergence goes?

And we make also short breaks count towards the total when they have reason hr_attendance_break.reason_imposed?

@albig
Copy link

albig commented Sep 18, 2023

  1. It's fully correct to handle shorter breaks like this. I had the problem, that ab break of 00:15 was not accepted with a configured break of 00:15. The problem are the seconds, we cannot (and don't want! to) see in the Odoo backend.
    A break from 2023-09-18 12:02:18 to 2023-09-18 12:17:17 is shown an 2023-09-18 12:02to 2023-09-18 12:17.
    --> Would it be possible to truncate the seconds?
  2. This would be a solution. Or just extend the "real" (e.g. 20 minutes) break with the "legal" break diff (e.g. 10 minutes)?
2023-09-18 12:02:18 2023-09-18 12:17:17

@hbrunn hbrunn marked this pull request as ready for review October 27, 2023 10:45
@albig
Copy link

albig commented Nov 17, 2023

If you click on break and try to stop the break again immediately, this will fail. It seems, that breaks < 1 minute cannot be interrupted.

@hbrunn
Copy link
Member Author

hbrunn commented Nov 20, 2023

that's because your custom code changes the resolution of this field to 1 minute - not sure how to deal with that yet

@albig
Copy link

albig commented Nov 20, 2023

Ahh, ok. Than this is no issue of this module. And maybe not that important.

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants