Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Artificial Intelligence
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Property Management
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Overtime YTD Balance

Subscriure's

Get notified when there's activity on this post

This question has been flagged
payrollAustralia
2 Respostes
1005 Vistes
Avatar
Syed Raza

Hi everyone, I’m trying to show Overtime YTD balance on the payslip at all times in AU Payroll.

Right now, overtime hours (Work Entry Type: OVERTIME) are being included inside Basic Salary through payslip.paid_amount, so OT is calculated but does not appear as a separate line and no OT YTD is shown.

Odoo does not allow “Work Entry Type” as a condition in Salary Rules, so I can’t trigger a rule directly from OVERTIME without causing duplication.

Does anyone know the correct way to display Overtime YTD on the payslip consistently in AU Payroll?

Thanks!

0
Avatar
Descartar
Zehntech Technologies Inc.

Hello Syed,

Please find below step by step explanation:

Step 1: Create / Verify Overtime Work Entry Type

Path: Payroll → Configuration → Work Entry Types

Ensure you have a dedicated Work Entry Type, e.g.:
Name: Overtime
Code: OVERTIME

This Work Entry Type should already be used by the attendance / planning / timesheet flow that generates OT hours.

At this stage, OT hours exist, but they are still merged into payslip.paid_amount.

Step 2: Create a Custom Input Type for Overtime

Path: Payroll → Configuration → Input Types

Create a new Input Type:
Name: Overtime Hours
Code: OT_HOURS
(Optional) Description: Overtime hours coming from Work Entries

This Input Type will act as the bridge between Work Entries and Salary Rules.

Step 3: Convert Overtime Work Entries into Payslip Inputs

This is the key step.

You need to override / extend payslip input computation so that Overtime Work Entries are extracted separately.

Concept:
Loop through Work Entries on the payslip
Filter entries with Work Entry Type = OVERTIME
Sum their duration (hours)
Push the result into the OT_HOURS input

Typical Python Extension (Example)
This is done in a small custom module:

from odoo import models

class HrPayslip(models.Model):
_inherit = 'hr.payslip'

def _get_inputs(self, contracts, date_from, date_to):
inputs = super()._get_inputs(contracts, date_from, date_to)

for slip in self:
ot_hours = sum(
slip.worked_days_line_ids.filtered(
lambda w: w.work_entry_type_id.code == 'OVERTIME'
).mapped('number_of_hours')
)

if ot_hours:
inputs.append({
'name': 'Overtime Hours',
'code': 'OT_HOURS',
'amount': ot_hours,
'contract_id': slip.contract_id.id,
})

return inputs

Result: OT hours are now explicitly available as an Input, instead of being hidden inside Basic Salary.

Step 4: Create a Dedicated Salary Rule for Overtime

Path: Payroll → Configuration → Salary Rules

Create a new rule under the appropriate structure (e.g. Earnings):

Name: Overtime
Code: OT
Category: Allowance / Overtime (AU-specific category if required)
Condition:
Input
Input Code = OT_HOURS

Salary Rule Computation
Example (hourly OT rate already defined on contract):

result = inputs.OT_HOURS.amount * contract.overtime_rate

Or if OT is a multiplier:

result = inputs.OT_HOURS.amount * contract.wage * 1.5

Step 5: Ensure Overtime Is Excluded from Basic Salary

To avoid duplication:
Make sure Basic Salary rule only uses:
Normal worked hours
NOT payslip.paid_amount if OT is included there
If needed, adjust Basic rule logic to exclude OT Work Entry Types

This guarantees OT is paid once and only once.

Step 6: Enable YTD Tracking for Overtime

In the Overtime Salary Rule:

Ensure:
“Show on Payslip” = ✅
Rule has its own unique code (OT)
Category is consistent across periods

Odoo automatically:
Aggregates rule results by code
Displays Year-to-Date (YTD) totals on the payslip

No extra YTD logic is required once OT is a standalone Salary Rule.

Hope it helps.

Avatar
Zehntech Technologies Inc.
Best Answer

In AU Payroll, overtime coming from Work Entries is merged into payslip.paid_amount, which is why it doesn’t generate a separate YTD line by default. Since Salary Rules can’t be conditioned directly on Work Entry Types, the correct approach is to separate OT at the work entry → input level (custom input type or computed input) and then reference that in a dedicated Salary Rule.

Once OT is isolated in its own rule, Odoo will track and display the OT YTD correctly on the payslip.

Regards,
Zehntech Technologies Inc.
Santosh.sekwadia@zehntech.com

0
Avatar
Descartar
Syed Raza
Autor

Hi Santosh,
Thank you for your response.
Could you please walk me through the detailed steps required to separate Overtime from Work Entries and configure it properly at the input level?
Specifically, I would appreciate guidance on:

>Creating a custom Input Type (if required)
>Linking Work Entry Types to the Input
>Configuring the dedicated Salary Rule for OT
>Any Python code needed in the Salary Rule computation
>Ensuring the OT appears as a separate YTD line on the payslip

A step-by-step explanation with example code snippets would be very helpful.

Kind regards,
Syed Ahmed Raza

Syed Raza
Autor

Hi
Thanks for your message and for taking the time to outline the steps — I really appreciate it.
However, I’m using Odoo Online (SaaS), so I’m not able to install custom modules or override _get_inputs as described.
Kind Regards

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Odoo's Basic Salary rule uses payslip.paid_amount which already aggregates all work entry types (including OVERTIME) into one figure. You can't simply add a new rule triggered by the OVERTIME work entry type — it'll double-count.

Recommended Solution: Split Basic Salary + Dedicated OT Rule
Step 1 — Modify the Basic Salary Rule
Change the Basic Salary rule so it excludes overtime hours from its calculation. In the rule's Python expression:
Basic Salary - OVERTIME work entries
total = 0
for line in payslip.worked_days_line_ids:
    if line.work_entry_type_id.code != 'OVERTIME':
        total += line.number_of_hours * (contract.wage / contract.resource_calendar_id.hours_per_week / 52 * ... )
result = total

The exact hourly rate formula depends on your contract structure (monthly vs. weekly wage), but the principle is to loop over worked_days_line_ids and skip the OVERTIME entry.

Step 2 — Create a Dedicated Overtime Salary Rule
Create a new rule (e.g. code: OT) in your salary structure:
Overtime Rule:

ot_line = next(
    (l for l in payslip.worked_days_line_ids
     if l.work_entry_type_id.code == 'OVERTIME'),
    None
)

if ot_line:
    hourly_rate = contract.wage / (contract.resource_calendar_id.hours_per_week * 52 / 12)
    result = ot_line.number_of_hours * hourly_rate
else:
    result = 0.0

Adjust the multiplier (1.5x, 2x, etc.) to match your award or agreement.


Hope it helps

0
Avatar
Descartar
Syed Raza
Autor

Hi,

Thanks for your detailed explanation.

I’ve tried implementing the changes as suggested (modifying the Basic Salary rule and creating a separate OT rule), but it’s still not working on my end — so I must be missing something in the configuration or formula.

Once again thanks for your help i really appreciate your response.

Regards,
Syed Ahmed Raza

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Why is overtime calculated over a 2 weeks period?
payroll
Avatar
Avatar
1
de març 26
1626
Batches of pay slips Solved
payroll
Avatar
Avatar
1
de set. 25
2584
payroll
payroll
Avatar
Avatar
1
de maig 25
4241
State of Utah - State Income Tax Withholding Salary Rule Parameter
payroll
Avatar
1
de març 25
3206
Duplicate Accounting Entries with Gross and Net in Payroll Structure (Odoo 17)
payroll
Avatar
0
de febr. 25
3927
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now