Ir al contenido
Odoo Menú
  • Inicia sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Inteligencia artificial
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de propiedades
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Comunidad
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Overtime YTD Balance

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
payrollAustralia
2 Respuestas
1009 Vistas
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.
Mejor respuesta

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
Mejor respuesta

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

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Why is overtime calculated over a 2 weeks period?
payroll
Avatar
Avatar
1
mar 26
1631
Batches of pay slips Resuelto
payroll
Avatar
Avatar
1
sept 25
2593
payroll
payroll
Avatar
Avatar
1
may 25
4249
State of Utah - State Income Tax Withholding Salary Rule Parameter
payroll
Avatar
1
mar 25
3212
Duplicate Accounting Entries with Gross and Net in Payroll Structure (Odoo 17)
payroll
Avatar
0
feb 25
3932
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

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