Payroll Module
Automatic salary calculation, rule management and batch processing in Odoo 19
The Payroll module is the core payroll processing system in Odoo 19, focusing on creating and calculating payslips by period, running batch payroll, configuring salary structures, and building salary rules with conditions and formulas.
The module integrates tightly with Work Entries for working days calculation, supports rule parameters with time-based history, and provides automatic deductions through Salary Adjustments.
Key Features
Key points
• Create and calculate payslips automatically by period with flexible formulas
• Run batch payroll (Pay Runs) to process multiple employees at once
• Configure salary structures (Payroll Structure) and structure types (Structure Type)
• Build salary rules with conditions and Python formulas
• Manage rule parameters with time-based history
• Automatic periodic deductions through Salary Adjustments
• Analyze Payroll and Work Entries data through pivot/list reports
• Dashboard warnings to detect anomalies before finalizing payroll
Important Terminology
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Payslip | Phiếu lương | Employee salary document for a specific period |
| Pay Run | Lô chạy lương | Group of payslips for the same period for batch processing |
| Salary Structure | Cấu trúc lương | Set of salary rules applied to employees |
| Salary Rule | Quy tắc lương | Formula to calculate salary components (basic, allowances, deductions) |
| Rule Parameter | Tham số quy tắc | Parameter value with time-based change history |
| Worked Days | Ngày công | Actual working days in the payroll period |
| Salary Inputs | Đầu vào lương | Additional input data (bonuses, penalties, advances) |
| Salary Adjustment | Điều chỉnh lương | Automatic periodic deduction or addition |
| Gross Salary | Lương gộp | Total salary before deductions |
| Net Salary | Lương thực nhận | Salary after all deductions |
Payslip States
Payslip Status
| Status | Meaning | Available Actions |
|---|---|---|
| Draft | Draft payslip, not yet calculated | Compute Sheet to calculate salary |
| Done / Validated | Calculated and confirmed, awaiting payment | Mark as Paid or Set to Draft |
| Paid | Payment made to employee | Revert to Done if adjustment needed |
| Cancelled | Cancelled, no longer valid | Set to Draft to reuse |
Main Menu Structure
The Payroll module organizes menus by main functional groups: Dashboard, Employees, Work Entries, Payslips, Reporting, and Configuration.
Key points
• Dashboard: Overview and system warnings
• Employees: Employee management and Salary Adjustments
• Work Entries: Working data as foundation for payroll calculation
• Payslips: Payslips and Pay Runs (batch payroll)
• Reporting: Work Entries Analysis, Headcount, Payslip Lines, Work Days Lines, Other Inputs
• Configuration: Settings, Salary (Rules, Parameters, Categories, Structures, Structure Types, Other Input Types), Dashboard Warnings
Configuring Salary Structure
Before running payroll, configure Structure Types and Structures to define pay schedule, work calendar, and applicable rule sets.
Steps
1. Go to Payroll → Configuration → Salary → Structure Types
2. Set default pay schedule (default_schedule_pay): monthly, bi-weekly, weekly
3. Choose default work calendar (default_resource_calendar_id)
4. Define default work entry type (default_work_entry_type_id)
5. Go to Payroll → Configuration → Salary → Structures
6. Create or edit Structure, attach required Salary Rules
7. Enable/disable worked day lines as needed
Salary Rules and Parameters
Salary Rules are the heart of the payroll system, allowing you to define application conditions and calculation methods for each salary component.
Key points
• Define conditions using condition_select: domain, input, python, or always
• Define calculation using amount_select: fixed amount, percentage, input, or python code
• Use Python code in condition_python and amount_python_compute for complex calculations
• Available variables: payslip, employee, version, result_rules, categories, worked_days, inputs
• Rule Parameters allow managing parameters by code with time-based change history
• History tab in Rule Parameters stores values by date_from for easy adjustments
Payroll Processing Workflow
Standard workflow for running monthly or periodic payroll in Odoo Payroll.
Steps
1. Prepare data: Check Work Entries, Employee Record (version_id), and Salary Adjustments
2. Create Pay Run: Go to Payslips → Pay Runs, create new and select period (date_start, date_end), structure, schedule
3. Generate Payslips: Click Generate Payslips button to create payslips for all eligible employees
4. Calculate: Click Compute in Pay Run to calculate all payslips, or Compute Sheet on individual payslips
5. Review: Check salary lines, review issues/warning_count on each payslip
6. Finalize: Click Confirm (action_validate) to move batch to Done
7. Payment: Click Mark as Paid (action_paid) when payment is made to employees
Salary Adjustments
Salary Adjustments allow declaring automatic periodic deductions or adjustments, such as loans, advances, or penalties.
Key points
• Access at Employees → Salary Adjustments
• Set up by employee, input type (Other Input Type), monthly amount (monthly_amount)
• Define total amount (total_amount) and effective period (date_start, date_end)
• Status: open (running) or close (completed)
• Actions: Mark as Completed, Running, Split (for multiple employees)
• System automatically adds to Salary Inputs of payslips during effective period
Salary Inputs on Payslips
Besides amounts calculated automatically from Salary Rules, you can add additional amounts for the current period.
Key points
• Open payslip, go to Salary Inputs tab
• Click Add Inputs (action_configure_payslip_inputs) to add new item
• Select input type (Other Input Type) and enter amount
• These inputs will be used in salary rule formulas to calculate final result
• Suitable for ad-hoc bonuses, penalties, or non-recurring amounts
Dashboard and Warnings
The Payroll Dashboard provides overview and warnings about issues to address before finalizing payroll.
Key points
• Access Dashboard via Payroll → Dashboard menu
• Configure warnings at Configuration → Dashboard → Warnings
• Each warning has evaluation_code (Python) and can be enabled/disabled by country
• Payslips have issues, warning_count, error_count systems
• Check and resolve warnings before Confirm to avoid errors
Reports and Analytics
The module provides various analytical reports to track payroll costs, working days, and inputs.
Key points
• Work Entries Analysis: Analyze working days by employee, work entry type, time
• Headcount: Employee count statistics
• Payslip Lines: Detailed analysis of salary lines by rule, category
• Payslip Work Days Lines: Analysis of working days on payslips
• Payslip Other Inputs: Analysis of other inputs
• Supports Pivot, Graph, List views for multi-dimensional analysis
Printing Documents and Exporting Reports
The system supports printing payslips and exporting payment reports for business processes.
Key points
• Payslip PDF: Print detailed payslip (action_report_payslip)
• Payslip Light: Print simplified payslip (action_report_light_payslip)
• Contribution Registers: Contribution report (action_report_register)
• Payment Report: Create batch payment file from Pay Run or Payslip
• Supports PDF export and other formats depending on configuration
Permissions and Security
Record rules ensure permission control by company (multi-company) and user role.
Main Permission Groups
| Group | Display Name | Permission Scope |
|---|---|---|
| group_hr_payroll_user | Officer: Manage all contracts | Manage contracts, work entries, and create payslips |
| group_hr_payroll_manager | Administrator | Full Payroll system access, configure rules and structures |
| group_payslip_display | Display payslip PDF | Permission to view and print payslip PDFs |
Practical Tips
Key points
• Finalize Work Entries data before clicking Compute to reduce payroll discrepancies
• Manage Rule Parameters with time-based history instead of hard-coding in multiple rules
• Standardize rule codes and categories from the start for easier report/pivot checking
• Use Pay Run for batch processing; only use off-cycle payslips for exceptions
• Monitor issues/warning_count on payslips before Confirm
• For Salary Adjustments with multiple employees, use Split for better individual status control
• Backup data before running first payroll or making major salary structure changes