[18.0][FIX] payroll_account: Fix _get_partner_id logic in hr_payslip_line #226
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 276 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.336
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #226"
general
weight: 0.35
nimarosa
Description
This PR fixes the partner logic in
hr_payslip_line._get_partner_id()to address issue #221 where journal entries were created without proper partner information in Odoo 17.0+.Problem
The original logic had several issues:
1. Odoo removed field
address_home_idfrom modelhr.employeewhich was used in getting partner for employee inpayroll_accountto set partner in created journal entry. Migrated code removed usage ofaddress_home_idbut did not use a replacement.2. Old code (16.0 and earlier) used a confusing fallback chain that could potentially assign wrong partners
3. Missing
liability_currentaccount type in partner-required accountsSolution
Replaced the flawed logic with semantically-correct partner assignment using the proper partner source:
Changes
Core Logic (payroll_account/models/hr_payslip_line.py)
Business Logic
| Account Type | Business Use | Partner Source |
|---|---|---|
| asset_receivable | Employee loans, advances | Employee |
| liability_current | Employee salary payable | Employee |
| liability_payable | Tax authorities, insurance | Register Partner |
| expense, income, etc. | Internal accounting | No Partner |
Test Coverage
Added
test_partner_logic_account_types()to verify:Fixes #221
---
Pull Request opened by Augment Code with guidance from the PR author