[19.0][MIG] payroll_account: Migration to 19.0 - #294
Open
amincheloh wants to merge 30 commits into
Open
Conversation
…or the payslip Until now this module tried to confirm an empty account move. This caused the account module to throw an exception. This causes problems in other modules that may not know about payroll_account. For example in other modules' tests.
…cumentation [14.0] [IMP] payroll: improve salary rules views and documentation [14.0] [IMP] payroll: improve salary rules and categories views [14.0] [IMP] payroll: improve salary rules views and documentation [14.0] [IMP] payroll: improve salary rules views and documentation [IMP] payroll: fix repeated words [14.0] [IMP] payroll: fix typos
[14.0] [IMP] payroll: change manifest category [14.0] [IMP] payroll: add migration for new payslip and payslips objects [14.0] [IMP] payroll: add migration for new payslip and payslips objects [14.0] [IMP] payroll: add migration for new payslip and payslips objects
In Odoo 17.0+, the address_home_id field was removed from hr.employee and replaced with work_contact_id. This caused journal entries to be created without proper partner information when no register partner was configured. This fix implements proper partner resolution logic: - For asset_receivable and liability_current accounts: Use employee partner (work_contact_id with fallback to bank_account_id.partner_id) - For liability_payable accounts: Use register partner - For other account types: No partner assigned Also includes proper null checks to prevent AttributeError when accessing .id on empty Many2one fields. Added minimal test coverage for the new partner logic to verify correct partner assignment for different account types. Fixes OCA#221
amincheloh
force-pushed
the
19.0-mig-payroll_account
branch
2 times, most recently
from
September 4, 2026 16:12
8160854 to
d813f7b
Compare
amincheloh
force-pushed
the
19.0-mig-payroll_account
branch
from
September 4, 2026 16:47
d813f7b to
f62b613
Compare
Author
|
@nimarosa please review PR, thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration of
payroll_accountto 19.0.Part of #216. Depends on
payroll19.0.1.0.0, already present in the 19.0 branch.Main changes
Contracts are now employee versions (
hr.contract→hr.version)analytic_account_idandjournal_idare declared onhr.version._get_whitelist_fields_from_template()override so both fields arecopied when a contract template is applied to an employee — without it, core
only propagates its own whitelist and the salary journal / analytic account of
a template would be silently dropped.
hr_contract_view_formnow inheritspayroll.hr_contract_view_form(thecontract template form) and adds an Accounting group after the contract
group.
hr_employee_view_forminheritance exposing both fields in the employeePayroll tab, right after
struct_id, since contract data is edited from theemployee form in 19.0.
Partner resolution on payslip lines
hr.employee.bank_account_idno longer exists;_get_partner_id()now fallsback to
primary_bank_account_id.partner_idwhen the employee has no workcontact.
Salary rules
[('deprecated', '=', False)]domain fromaccount_debitandaccount_credit:account.account.deprecatedno longer exists in 19.0.Misc
_()→self.env._()with named interpolation parameters.18.0.1.0.2migration scripts.completed instead of creating an
hr.contract,gender→sex,bank_account_id→bank_account_ids), plus a new test covering the bankaccount fallback in the partner logic.
Notes for reviewers
The branch replays the module history from 18.0; administrative commits
(Weblate,
[BOT] post-merge updates,.potand README regenerations) have beensquashed into their preceding functional commit as suggested by the migration
wiki.