Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Overtime YTD Balance

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
payrollAustralia
2 Réponses
1006 Vues
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
Ignorer
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.
Meilleure réponse

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
Ignorer
Syed Raza
Auteur

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
Auteur

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
Meilleure réponse

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
Ignorer
Syed Raza
Auteur

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

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Why is overtime calculated over a 2 weeks period?
payroll
Avatar
Avatar
1
mars 26
1628
Batches of pay slips Résolu
payroll
Avatar
Avatar
1
sept. 25
2585
payroll
payroll
Avatar
Avatar
1
mai 25
4243
State of Utah - State Income Tax Withholding Salary Rule Parameter
payroll
Avatar
1
mars 25
3207
Duplicate Accounting Entries with Gross and Net in Payroll Structure (Odoo 17)
payroll
Avatar
0
févr. 25
3928
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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