Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Kecerdasan Buatan
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Manajemen Properti
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Konsultasi
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Overtime YTD Balance

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
payrollAustralia
2 Replies
1003 Tampilan
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
Buang
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.
Jawaban Terbai

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
Buang
Syed Raza
Penulis

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
Penulis

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
Jawaban Terbai

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
Buang
Syed Raza
Penulis

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

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Why is overtime calculated over a 2 weeks period?
payroll
Avatar
Avatar
1
Mar 26
1622
Batches of pay slips Diselesaikan
payroll
Avatar
Avatar
1
Sep 25
2582
payroll
payroll
Avatar
Avatar
1
Mei 25
4239
State of Utah - State Income Tax Withholding Salary Rule Parameter
payroll
Avatar
1
Mar 25
3206
Duplicate Accounting Entries with Gross and Net in Payroll Structure (Odoo 17)
payroll
Avatar
0
Feb 25
3925
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Karir
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah software terintegrasi dengan 70+ aplikasi seperti CRM, Akuntansi, Inventaris, Sales, eCommerce, Marketing, POS; plus fitur lokal Indonesia!

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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