Payroll Accounting Integration
Automate journal entries from payslips and payments
The Payroll Accounting module is the integration layer between Payroll and Accounting, helping convert salary data into automatic journal entries.
The module adds Salary Journal to salary structures, accounting accounts for each Salary Rule, and supports direct salary payments from payslips.
Key Features
Key points
• Automatically create journal entries from payslip/pay run upon confirmation
• Configure Salary Journal on salary structure to define the journal
• Set up Debit/Credit accounts for each Salary Rule
• Pay salaries directly from payslip using Payment Register
• Support batch move lines by company (Batch Payroll Move Lines)
• Reverse link between payslip/pay run and journal entry
• Analytic Distribution for salary expenses
• Support Tax Grids on journal entry lines
Accounting Terminology
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Salary Journal | Sổ nhật ký lương | Accounting journal used to record salary entries |
| Accounting Entry | Bút toán kế toán | Accounting document created from payslip |
| Move State | Trạng thái bút toán | Draft, Posted, or Cancel |
| Debit Account | Tài khoản ghi Nợ | Debit side account in journal entry |
| Credit Account | Tài khoản ghi Có | Credit side account in journal entry |
| Reconciliation | Đối soát | Process of matching accounting lines with payments |
| Payment Register | Đăng ký thanh toán | Wizard to create payment document |
| Analytic Distribution | Phân bổ phân tích | Expense allocation by analytical dimension (department, project) |
| Tax Grids | Thẻ thuế | Tax tags attached to journal entry lines |
| Batch Payroll Move Lines | Gộp dòng bút toán lương | Combine multiple payslips into fewer accounting lines |
Journal Entry States
Journal Entry Status
| Status | Meaning | Actions |
|---|---|---|
| Draft | Draft entry, not yet posted | Can edit, Post to finalize |
| Posted | Posted to ledger, cannot edit | Can pay, Reset to Draft if needed |
| Cancel | Cancelled, no longer valid | Cannot use |
Configure Salary Journal on Structure
Before running payroll, configure Salary Journal on salary structure to define which journal to use for entries.
Steps
1. Go to Payroll → Configuration → Salary → Structures
2. Open or create Structure to configure
3. Fill in Salary Journal field (journal_id) - this is required
4. Ensure journal currency matches company currency
5. Save configuration
Configure Accounts on Salary Rule
Each Salary Rule needs Debit/Credit accounts so the system knows how to account for that salary component.
Steps
1. Go to Payroll → Configuration → Salary → Rules
2. Open rule to configure
3. Go to Accounting tab
4. Fill in Debit Account (account_debit): debit side account
5. Fill in Credit Account (account_credit): credit side account
6. Optional: configure Analytic Distribution, Tax Grids, Split on names, Set employee on account line
7. Save configuration
Advanced Options on Salary Rule
Key points
• Analytic Distribution: Allocate expenses by analytical dimension (department, project, branch)
• Debit Tax Grids / Credit Tax Grids: Attach tax tags to Debit/Credit lines
• Split on names: Split journal entry lines by employee name
• Set employee on account line: Attach employee information to journal entry line
• Excluded from Net: Exclude from Net calculation (not counted in net salary)
Create Journal Entry from Payslip
When confirming payslip, the system automatically creates journal entry based on Salary Rules configuration.
Steps
1. Create and calculate payslip normally in Payroll
2. Click Create Draft Entry (instead of regular Confirm)
3. System changes payslip state and calls _action_create_account_move()
4. Journal entry lines created from payslip line_ids via _prepare_slip_lines()
5. If Debit/Credit mismatch, system adds Adjustment Entry line using journal default account
6. move_id linked back to payslip (and pay run if batch enabled)
7. Open Journal Entry from smart button on payslip to view details
Pay Salary from Journal Entry
After entry is Posted, you can pay salary directly from payslip.
Key points
• Requirements: payslip not yet paid, entry posted, NET rule credit account must have reconcile=True
• Employee bank account must be trusted (allow_out_payment)
• Click Pay button on payslip to open Payment Register wizard
• Wizard has hr_payroll_payment_register context for payroll-specific handling
• After reconciling full residual, payslip automatically updates to state=paid and sets paid_date
Batch Payroll Move Lines
This option allows combining multiple payslips from same journal/period into fewer journal entry lines, reducing accounting line count.
Key points
• Enabled: Combine multiple payslips into fewer lines, hide individual details
• Disabled: Create details per payslip/rule, easier to trace individual employees
• Trade-off: Batch reduces accounting lines but limits some individual payment operations
Steps
1. Go to Settings → Payroll
2. Enable Batch Account Move Lines option (batch_payroll_move_lines)
3. Save configuration
Analytic Distribution on Employee
You can configure default Analytic Distribution on employee to automatically allocate salary expenses.
Key points
• Open Employee form in Payroll
• Fill in Analytic Distribution field
• This distribution is used as fallback when rule has no specific analytic
• Example: 100% to IT department, or 50% project A + 50% project B
Reverse Link from Journal Entry
From journal entry, you can open related payslip to view details.
Key points
• Open Journal Entry in Accounting
• Click Payslip stat button to open related payslip
• Helps trace from accounting back to salary source
Handling Payslip Cancellation
When cancelling payslip with journal entry, system automatically handles related entry.
Key points
• Module calls _unlink_or_reverse() on move_id before continuing original flow
• Entry will be reversed or unlinked depending on status
• Ensures consistency between Payroll and Accounting
Permissions and Control
Permission to view accounting features uses accounting groups.
Key points
• account.group_account_readonly: View Journal Entry smart button
• account.group_account_invoice: Execute Pay button
• Payroll actions still follow Payroll permissions (group_hr_payroll_user, group_hr_payroll_manager)
Important Notes
Key points
• action_payslip_done() creates journal entry immediately after confirming payslip
• If structure missing journal_id, payslip will have warning
• When batch_payroll_move_lines=True, employee_move_line is hidden on rule UI
• On NET rule, not_computed_in_net affects how NET line is calculated when building entry
• Tax lines (debit_tag_ids/credit_tag_ids) are pushed to move lines according to debit/credit accounts
Practical Tips
Key points
• Standardize Salary Rules accounting before running first payroll period
• Always check Journal Entry status (Draft/Posted) from payslip/pay run before payment
• If accounting mismatch, debug in order: Rule account → Structure journal → NET rule reconcile → Bank trust
• Only enable Batch Payroll Move Lines when company accepts lower accounting detail level
• Use analytic_distribution consistently between rule and employee for correct expense reporting
• Test with one payslip before batch processing to ensure correct configuration