Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
5749 Vistas

Hi everyone,

I'm seeking help to configure a flexible working hours in Odoo. Ideally, I want the system to allow me to simply input the hours each employee needs to work daily, without any additional complications like work from or work to. So far, I've been having issues with the configuration of overtime hours and need to streamline the process.


Current problem:

  1. Configured Work Schedule:
    • María is scheduled to work on Mondays from 8:00 to 12:00 and then from 14:00 to 18:00.
    • This totals 8 hours of work per day.
  2. Ideal Functioning:
    • If María strictly follows this schedule, Odoo correctly calculates her overtime hours.
  3. Problem:
    • If, for any reason, María starts working earlier or skips her lunch break, Odoo counts the hours worked outside her scheduled time as overtime.


Example Scenario:

  • Scheduled Hours:
    • 8:00 to 12:00 (4 hours)
    • 14:00 to 18:00 (4 hours)
    • Total: 8 hours
  • Actual Hours Worked:
    • María starts working at 7:30 and works continuously until 15:30 without a lunch break.
    • Total: 8 hours

Issue:

  • Odoo sees the hours from 7:30 to 8:00 (0.5 hours) and from 12:00 to 14:00 (2 hours) as outside her scheduled hours and therefore counts these as overtime.
  • Similarly, any hours worked after 18:00 are also counted as overtime.


Could anyone guide me step-by-step on how to set up this configuration in Odoo? Any tips or experiences you could share would be greatly appreciated.


Thanks in advance!

Avatar
Descartar

If the goal is to manage flexible shifts, maybe this app - https://apps.odoo.com/apps/modules/16.0/itlibertas_timesheet - might be of use

Autor

Thank you.
I'll try that module, it seems that we can configure it to do something similar, I hope it helps us.
All the best.

Autor Mejor respuesta

Thank you for your prompt response.

I apologize if I didn't explain myself clearly before. We need the solution for the community version of the program, which does not have the payroll module nor the option you mentioned: "Go to Attendance > Configuration > Settings and check that the attendance is set up to capture actual working hours accurately."

Or i need to get any modules from OCA?


Avatar
Descartar
Mejor respuesta

To achieve this in Odoo, you will need to adjust the attendance and overtime calculation rules to ensure that any work beyond 8 hours is considered overtime, regardless of whether it falls outside the scheduled working hours. Here’s a step-by-step guide to help you set it up:

  1. Define Working Hours:
    • Define the working schedule in Odoo: 8:00 to 12:00 and 14:00 to 18:00.
  2. Adjust Attendance Rules:
    • Ensure that the attendance module correctly tracks the employee's actual working hours.
    • Go to Attendance > Configuration > Settings and check that the attendance is set up to capture actual working hours accurately.
  3. Create a Custom Overtime Rule:
    • Navigate to Payroll > Configuration > Salary Rules.
    • Create a new salary rule for overtime. For example, "Overtime Calculation".
  4. Set Up Overtime Conditions:
    • In the new salary rule, define the condition for overtime calculation. You can do this using Python code within the rule.

​ worked_hours = contract.employee_id.timesheet_ids.filtered(lambda t: t.date >= payslip.date_from and t.date

​total_hours = sum(worked_hours.mapped('unit_amount'))

​overtime_hours = total_hours - 8 if total_hours > 8 else 0

​result = overtime_hours


5. Integrate the Rule into Payslip:

  • Include the overtime rule in the employee’s salary structure so that it is calculated during payslip generation.
  • Go to Payroll > Configuration > Salary Structures and add the new overtime rule to the relevant salary structure.

6. Test the Setup:

  • After setting up, create a payslip for an employee who has worked the described hours (7:30 to 15:30) and verify that the overtime is calculated correctly.

By setting up this custom overtime rule, Odoo will calculate overtime based on actual hours worked, regardless of the predefined schedule, ensuring that any work beyond 8 hours is accurately identified as overtime.


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
nov 24
1456
2
ago 19
8384
0
mar 15
4146
1
sept 25
7110
2
jul 22
4159