Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie



Body:

Hello Odoo Community,

I’m working on an HR setup in Odoo 18 and need advice on implementing automatic overtime calculation.

Here is the requirement:

  1. Overtime should be calculated directly from attendance records (hr.attendance)without depending on worked_days_line_ids.
  2. If the day is a regular working day, overtime hours should be paid at 1.5x.
  3. If the day is a holiday (according to the company’s resource calendar), overtime hours should be paid at 2x.
  4. The total overtime hours should appear automatically in the employee payslip or in a dedicated monthly report.

What I’ve tried so far:

  • I created a computed field (overtime_hours) on hr.employee to sum overtime based on attendance records.
  • The main challenge is reliably detecting whether a given date is a holiday or workday using the company calendar (resource.calendar), especially when considering public holidays.

My questions:

  • What is the best practice to leverage resource.calendar for identifying holidays and workdays in this scenario?
  • Are there existing modules or code snippets that handle similar overtime rules?
  • What’s the recommended way to integrate these calculations into QWeb reports (e.g., a monthly overtime PDF for each employee)?

Any guidance, best practices, or sample code would be greatly appreciated.

Thank you in advance for your support!

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
mar 25
6591
0
gru 24
5467
0
lis 24
5092
0
gru 24
4518
1
wrz 25
5947