Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Umělá inteligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Overtime YTD Balance

Odebírat

Get notified when there's activity on this post

This question has been flagged
payrollAustralia
2 Odpovědi
1008 Zobrazení
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
Zrušit
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.
Nejlepší odpověď

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
Zrušit
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
Nejlepší odpověď

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
Zrušit
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!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Why is overtime calculated over a 2 weeks period?
payroll
Avatar
Avatar
1
bře 26
1629
Batches of pay slips Vyřešeno
payroll
Avatar
Avatar
1
zář 25
2588
payroll
payroll
Avatar
Avatar
1
kvě 25
4245
State of Utah - State Income Tax Withholding Salary Rule Parameter
payroll
Avatar
1
bře 25
3208
Duplicate Accounting Entries with Gross and Net in Payroll Structure (Odoo 17)
payroll
Avatar
0
úno 25
3929
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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