How-to

Odoo 19 Night Shift Payroll: Schedules, Work Entries and Absences

A step-by-step guide to configuring shifts that cross midnight in Odoo 19 Enterprise, covering working schedules, attendance, work entries, payroll rules, late or missing punches, and time off.

Kalvyai Engineering · · 9 min read

Odoo 19 Night Shift Payroll: Schedules, Work Entries and Absences (cover)
On this page

This guide covers Odoo 19 Enterprise. Payroll and work entries are Enterprise-only, so it does not apply to Community. Most of the logic also holds for Odoo 17 and 18 Enterprise, but field locations differ. Odoo 19 moved contract data onto the employee record, so confirm menu paths on your database before you follow them.

The example shift throughout is 19:00 to 06:00, starting on one date and ending on the next.

How Odoo sees a night shift

Three facts explain almost every night shift problem:

  1. Working schedule lines cannot cross midnight. Each line belongs to one weekday and has a start and end hour between 00:00 and 24:00. A 19:00 to 06:00 shift must be two lines on two different weekdays.
  2. Attendance records can cross midnight. One check-in at 19:02 on Monday and one check-out at 06:05 on Tuesday is one attendance record. Odoo stores both times in UTC and shows them in the user's timezone.
  3. Payroll counts work entries, not shifts. A payslip adds up work entry hours (and days) by work entry type for the pay period. It has no built-in idea of "one shift". You have to design your rules so that hours, not calendar days, drive the pay.

If you keep these three in mind, the setup becomes straightforward.

Step 1: Configure the night shift working schedule

Open the Working Schedules list from the configuration menu of the Payroll or Employees app and create a new schedule, for example "Night 19-06 Mon-Fri".

  1. Set the Timezone on the schedule to the timezone where the employees actually work. This is the most common cause of shifted or split entries.
  2. Remove the default day lines.
  3. Add one evening line and one morning line per shift. Each shift's morning part goes on the next weekday.
  4. Use 24:00 as the end of the evening line, not 23:59. Using 23:59 loses one minute per shift, which shows up as small differences in hours and in overtime.
  5. If the shift has an unpaid break, leave a gap for it instead of covering it with a line.

For a Monday to Friday night shift with a one-hour unpaid break from 00:00 to 01:00:

Weekday

From

To

Belongs to shift starting

Monday

19:00

24:00

Monday

Tuesday

01:00

06:00

Monday

Tuesday

19:00

24:00

Tuesday

Wednesday

01:00

06:00

Tuesday

Wednesday

19:00

24:00

Wednesday

Thursday

01:00

06:00

Wednesday

Thursday

19:00

24:00

Thursday

Friday

01:00

06:00

Thursday

Friday

19:00

24:00

Friday

Saturday

01:00

06:00

Friday

Notice that Monday has no morning line and Saturday has a morning line. That is correct: Saturday morning is the end of Friday night's shift.

If your build rejects 24:00 as an end time, use 23:59 and accept the one-minute gap, but be consistent across all schedules.

Average hours per day

The schedule has an Average Hour per Day value. Odoo uses it to convert hours into days, for example in time off balances. For the table above, each shift is 10 paid hours, so set it to 10 if it is not computed that way. A wrong value here makes leave allocations in days look wrong even when hours are right.

Should you use flexible hours instead?

Odoo 18 and later offer a flexible hours option on working schedules. It removes fixed start and end times, which avoids the midnight split, but it also removes the expected time window that time off and absence detection depend on. For a fixed 19:00 to 06:00 shift, the split schedule above is the better choice.

Step 2: Link the schedule and choose the work entry source

Open each night shift employee and set:

  1. Working Hours / Working Schedule: the night schedule from Step 1.
  2. Timezone: the same timezone as the schedule.
  3. Work Entry Source.

The work entry source decides how hours reach payroll. Pick one of these two models.

Model A: Attendances (pay what was worked)

Work entries are created from real check-in and check-out times. Late arrival and early exit automatically reduce paid hours. Absence produces no attendance entry, so hours are simply missing. This fits hourly or shift-paid staff.

Model B: Working Schedule (pay the plan, deduct exceptions)

Work entries are created from the schedule. Every planned shift is paid unless time off or an unpaid entry replaces it. Attendance is used for checking and overtime, not as the pay basis. This fits monthly-salaried staff where only approved absences reduce pay.

Do not mix the two in one payroll structure without a clear rule. Most problems with "wrong night shift pay" come from employees on different sources sharing one structure.

Step 3: Configure Attendances for cross-midnight shifts

In Attendances settings, review these options:

  1. Check-in mode: kiosk, badge, or self check-in all store full datetimes, so crossing midnight is not a problem in itself.
  2. Automatic check-out: if available in your version, this closes open attendances after a set time beyond the planned schedule. Test it with a night employee who forgets to check out, because the "end of schedule" is on the next date.
  3. Absence management: if available, this logs an absence when an employee with a planned schedule does not check in. Test it on a night schedule, because the planned start is late in the day.
  4. Overtime: Odoo compares worked hours with planned hours. Check how your version groups overtime by date for a shift that starts on one day and ends on the next, and set tolerances so a few minutes early or late do not create overtime.

The test that matters: create one attendance from Monday 19:00 to Tuesday 06:00 and confirm the employee shows 10 worked hours and zero overtime.

Step 4: Set up work entry types

Open Payroll > Configuration > Work Entry Types and review:

Work entry type

Typical code

Use

Attendance

WORK100

Normal worked hours (default)

Overtime

Check the code in your database

Extra hours if you pay overtime

Unpaid

Check the code in your database

Unpaid absence or leave

Your paid leave types

per leave type

Approved paid time off

You usually do not need a separate "Night Shift" work entry type. If night workers have their own payroll structure, every attendance hour on their payslip is already a night hour. Create a separate type only if the same employee works both day and night shifts in one pay period and the hours must be paid at different rates. That case usually needs Planning-based work entries or a small customisation.

In your payroll structure, check which work entry types are treated as unpaid, so that unpaid absence reduces basic pay.

Step 5: Generate and check work entries

  1. Open the work entries view.
  2. Generate or regenerate work entries for the pay period.
  3. Look at a few night shifts. Depending on the version, one attendance may appear as one entry or as two entries split at midnight. Either is fine as long as the total hours are correct.
  4. Resolve every conflict (shown in red). Payslips cannot be computed cleanly while conflicts exist. Typical conflicts are overlaps between time off and attendance, or an attendance left open.
  5. If you change a schedule or attendance after generating, regenerate the affected period.

Month-end shifts

A shift from 31 March 19:00 to 1 April 06:00 is split across two pay periods: 5 hours in March, 5 hours in April. This is correct for hour-based pay. If your policy is to pay the whole shift in the month it started, you need a custom rule or a custom period boundary, and you should decide that before go-live.

Step 6: Build the payroll structure and rules

The key rule for night shifts: calculate from hours, not days. One shift touches two calendar dates, so day counts on the payslip can show two partial days for one shift. Hours are always accurate.

Set the employee's wage type to hourly if you pay per hour worked (Model A), or monthly if you pay a fixed salary (Model B).

Store rates as rule parameters so you can change them without editing code. Then add rules like these to the night shift structure.

Basic pay prorated by attended hours (Model A with a monthly wage):

Python
# Odoo 19: the wage is on the employee version (version), not on contract
monthly_wage = version.wage
expected_hours = payslip._rule_parameter('NIGHT_EXPECTED_HOURS')
worked = worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
result = monthly_wage * min(worked / expected_hours, 1.0)

Night shift allowance per worked hour:

Python
rate = payslip._rule_parameter('NIGHT_ALLOWANCE_HOURLY')
hours = worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
result = hours * rate

Night shift allowance per full shift (counts 10 paid hours as one shift):

Python
shift_hours = 10.0
per_shift = payslip._rule_parameter('NIGHT_ALLOWANCE_PER_SHIFT')
hours = worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
result = (hours // shift_hours) * per_shift

The last rule only pays for complete shifts, so a late arrival on one night removes that night's allowance. Choose the version that matches your written policy. Test every rule on a payslip with known hours before using it for real.

Step 7: Late arrival, early exit and missing punches

Odoo does not apply late-arrival penalties out of the box. Here is how each case behaves and what to configure:

Case

Model A (Attendances)

Model B (Schedule)

Late arrival

Fewer worked hours, lower pay automatically

No effect unless you add a deduction rule or unpaid entry

Early exit

Same as late arrival

Same as above

Missing check-out

Attendance stays open; fix it or let automatic check-out close it before generating entries

Pay is unaffected, but overtime reports are wrong until fixed

Missing check-in

No attendance, no hours; HR must add the record if the employee did work

Pay unaffected

If you need a fixed penalty per late arrival (for example, a set amount after 15 minutes), that is a policy rule Odoo does not provide by default. It can be handled with a payslip input that HR fills in, or with a customisation that counts late check-ins.

Always review open attendances before generating work entries for the period.

Step 8: Leave and absence for shifts that cross midnight

Time off in Odoo is calculated against the schedule lines that fall inside the requested dates. With a split night schedule, a full-day request for Tuesday only covers Tuesday 01:00 to 06:00 (the end of Monday's shift) and Tuesday 19:00 to 24:00 (the start of Tuesday's shift). It does not cover one whole shift.

To map one missed night shift correctly:

  1. Agree a rule: a shift belongs to the date it starts on.
  2. For one missed shift starting Tuesday, the time off must cover Tuesday 19:00 to 24:00 and Wednesday 01:00 to 06:00.
  3. Use an hours-based request if your leave type allows it, or request Tuesday to Wednesday and check that the computed duration is 10 hours, not 20.
  4. Keep leave types in hours rather than days for night workers, so balances are not distorted by the two-date split.

For unplanned absence:

  • Model A: no attendance means no hours. The prorated basic rule above reduces pay automatically. Use absence management or a report to make sure absences are explained.
  • Model B: record the absence as unpaid time off so an unpaid work entry replaces the planned hours.

Test checklist before go-live

Run one test employee through a full pay period with these cases:

  1. A normal shift, Monday 19:00 to Tuesday 06:00.
  2. A shift 20 minutes late.
  3. A shift with no check-out.
  4. One missed shift with no time off.
  5. One shift covered by paid time off.
  6. A shift crossing the last day of the month.
  7. A weekend shift if your schedule includes one.

For each, compare the work entries, the payslip worked days, and the final amounts with a manual calculation. Fix the schedule or rules before adding real employees.

How Kalvyai can help

Night shift payroll is mostly configuration, but the edge cases (month-end splits, per-shift allowances, late penalties, mixed day and night staff) often need a small amount of custom logic. Kalvyai implements and customises Odoo, including Payroll, Attendances and work entry rules, and can review your setup against your actual shift policy. If you want help, contact us.

Share this article

  • Odoo 19
  • Odoo Payroll
  • Night Shift
  • Work Entries
  • Attendance
  • Odoo Enterprise

Kalvyai Engineering · Engineering team

The engineers who build, connect and fix business systems at Kalvyai: Odoo, ERPNext, Shopify and AI agents that work inside them with approvals, budgets and an audit trail.

Comments

No comments yet. Questions and corrections are welcome.

Rate this post or leave a comment

Your rating (optional)
Not rated

Comments appear after an editor approves them. See our privacy notice.

Read next

WhatsApp Coexistence for Odoo 19: Setup and User Guide (cover)User guide
Kalvyai EngineeringOdoo

WhatsApp Coexistence for Odoo 19: Setup and User Guide

How to install, connect and use WhatsApp Coexistence for Odoo 19 so your team keeps replying from the WhatsApp Business app while Odoo logs every message on the same number.

7 min read

Newsletter

Get new guides in your inbox.

Practical notes on Odoo, ERPNext, Shopify and AI agents, written by the engineers who build them. No spam, and you can ask to stop at any time.

Prefer a feed? Subscribe by RSS. We use your email only to send new articles. See our privacy policy.