HR Payroll Links for Odoo 17
Loans, advances, overtime and gratuity reach the payslip as input lines, rebuilt on every compute and locked in only when the slip is paid.
Why this module
HR Payroll Links for Odoo 17
The request actually gets paid
Approving a loan, advance, overtime or gratuity in its own module is not enough on its own. This bridge feeds each one into the payslip as an input line the salary rules read, so the amount lands in gross, deductions and net.
Paid once, never again
Source records are flagged processed only when the payslip is paid. Loan instalments are marked paid, advances marked recovered, overtime and gratuity marked processed. A later payslip for the same period feeds nothing back in.
Recompute reflects reality
Auto inputs are unlinked and rebuilt on every compute, so the slip always mirrors the current loan balance and the latest approved overtime. Manual inputs you keyed by hand are left untouched.
Day in the life
From request to net pay
An employee has a loan instalment of 200 due on the 15th, a 300 advance to recover this month, ten paid overtime hours marked done, and an approved gratuity. You compute the January payslip. The bridge searches each source for that employee and period, then writes four input lines: LOAN, ADVANCE, OT_HOURS and GRATUITY. Your salary structure rules turn OT_HOURS into pay at the hourly rate, GRATUITY into an allowance, and LOAN and ADVANCE into deductions. Gross, deductions and net update accordingly. You confirm and pay the slip. At that moment the loan instalment is marked paid, the advance recovered, and the overtime and gratuity processed. Run a second slip for the same period and nothing feeds back in.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
Each feeder filters out already processed source records and the slip flags them processed only on pay, so a re-run or a second slip for the same period deducts nothing twice.
On every compute the auto inputs are deleted and rebuilt from the live sources, so the slip tracks the current loan balance and the newest approved overtime without stale lines piling up.
Only inputs flagged as auto are rebuilt. Input lines you entered by hand are preserved across recompute and are never marked auto.
Only the right states feed pay: an advance must be paid, overtime must be paid compensation and done, a gratuity must be approved, and a loan instalment must not already be marked paid.
Every feeder is bounded by the payslip date_from and date_to, matched on loan due date, advance recovery month, overtime work date and gratuity computation date, so amounts land in the correct pay run.
Overtime is fed as compensated hours in the input quantity, not a fixed amount, so a salary rule applies the employee hourly rate rather than baking in a figure.
On pay, only the source types that actually produced an input on that slip are marked processed, so an unrelated pending request for the same employee stays untouched.
What is inside
Built to do the job, end to end.
- _collect_auto_inputs override. Extends the payslip hook to append loan, advance, overtime and gratuity input dicts for the employee and period. Returns code, name, amount or quantity and a source tag the parent uses to flag the line as auto.
- _on_payslip_paid override. Runs when a slip is paid. For each source type that produced an input on the slip, it re-runs the same search and writes the processed marker: loan lines to paid, advances to recovered, overtime and gratuity to processed.
- Processed marker fields. Adds eh_payslip_processed to overtime and gratuity and eh_payslip_recovered to salary advance, each read only and not copied, so the paid state cannot be silently flipped or carried onto a duplicate.
- Salary rule integration. Nothing is hard coded into pay. The structure decides treatment by reading inputs.LOAN.amount, inputs.OT_HOURS.quantity and the rest in rule formulas, so the same feed can be a deduction, an allowance or scaled by any rate you choose.
Honest about the edges
What this does not do, so nothing surprises you.
- This is a bridge only. It feeds amounts into the payslip and does not create or approve loans, advances, overtime or gratuity. Those workflows live in their own modules.
- It depends on eh_hr_payroll, eh_hr_loan, eh_hr_overtime, eh_hr_gratuity and eh_hr_salary_advance. All five must be installed for it to function.
- It ships no views, menus, wizards or scheduled jobs. It hooks into the existing payslip compute and pay actions and adds three marker fields.
- Feeders are scoped by employee and pay period, not by company. In a multi company setup, scope is governed by the source modules and your record rules.
- The no double deduction guarantee is enforced by marking source records processed on pay and rebuilding auto inputs on compute, not by database advisory locks or savepoints.
- How each input becomes pay or a deduction depends entirely on your salary structure rules. Without a rule that references the input code, the amount will not affect net.
odoo 17 payroll loan deduction, salary advance recovery payroll, overtime to payslip odoo, end of service gratuity payroll, payslip input lines automation, hr loan installment deduction, payroll feeder module odoo, salary rule input code, automatic payslip inputs, idempotent payroll deductions, odoo community payroll bridge, no double deduction payslip
Need this fitted to the way you work?
ERP Heritage delivers end to end Odoo work: Odoo Implementation, Customization and Development, Integration, Migration, Consultation, Support and Training. We help teams put this module into production, shape it to their process, and keep it running.
We work with businesses across Australia (Melbourne, Sydney, Brisbane, Perth, Adelaide, Canberra) and the Middle East (Dubai, Abu Dhabi, Riyadh, Jeddah, Doha, Kuwait City, Muscat). Start a conversation at erpheritage.com.au or email info@erpheritage.com.au.
Languages
Available in 19 languages
The interface ships translated out of the box. Switch language in Odoo and the fields, menus, and messages follow.
Please log in to comment on this module