Skip to content

[19.0] [MIG] payroll_account: Migration to 19.0 - #269

Open
stferraro wants to merge 69 commits into
OCA:19.0from
Jenrax-git:19.0-mig-payroll_account
Open

stferraro wants to merge 69 commits into
OCA:19.0from
Jenrax-git:19.0-mig-payroll_account

Conversation

@stferraro

Copy link
Copy Markdown
Contributor

@stferraro stferraro mentioned this pull request May 19, 2026
2 tasks
@stferraro
stferraro force-pushed the 19.0-mig-payroll_account branch from 4394c4f to a1d3d98 Compare May 19, 2026 17:45

@Yusuke1998 Yusuke1998 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stferraro
stferraro force-pushed the 19.0-mig-payroll_account branch 3 times, most recently from 5775721 to 777b281 Compare August 14, 2026 21:44
@nimarosa

Copy link
Copy Markdown
Contributor

/ocabot rebase

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@nimarosa The rebase process failed, because command git push --force Jenrax-git tmp-pr-269:19.0-mig-payroll_account failed with output:

remote: Permission to Jenrax-git/payroll.git denied to OCA-git-bot.
fatal: unable to access 'https://github.com/Jenrax-git/payroll/': The requested URL returned error: 403

@nimarosa

Copy link
Copy Markdown
Contributor

@stferraro please rebase to see if it has no conflicts since it's a old PR. I can't do it automatically because you disabled access to your branch.

If everything pass again i merge it.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@stferraro
stferraro force-pushed the 19.0-mig-payroll_account branch from 777b281 to 73fc9d3 Compare August 17, 2026 06:26
@stferraro

Copy link
Copy Markdown
Contributor Author

@nimarosa the rebase went through clean (no conflicts) and all checks are green now — pre-commit, tests on Odoo and OCB, codecov, and runboat all passed. Ready for you to merge whenever you get a chance. Thanks!

@Karla-Villegas Karla-Villegas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stferraro

Copy link
Copy Markdown
Contributor Author

Hi @nimarosa , please merge this module to merge !

@MohanadAbugharbia

Copy link
Copy Markdown

Any news on the status of this pull request? I would like to see this in 19.0.

Thank you.

OCA-git-bot and others added 16 commits October 20, 2026 09:26
Currently translated at 100.0% (22 of 22 strings)

Translation: payroll-18.0/payroll-18.0-payroll_account
Translate-URL: https://translation.odoo-community.org/projects/payroll-18-0/payroll-18-0-payroll_account/es_VE/
Currently translated at 100.0% (22 of 22 strings)

Translation: payroll-18.0/payroll-18.0-payroll_account
Translate-URL: https://translation.odoo-community.org/projects/payroll-18-0/payroll-18-0-payroll_account/es/
Currently translated at 100.0% (22 of 22 strings)

Translation: payroll-18.0/payroll-18.0-payroll_account
Translate-URL: https://translation.odoo-community.org/projects/payroll-18-0/payroll-18-0-payroll_account/tr/
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
@stferraro
stferraro force-pushed the 19.0-mig-payroll_account branch from 73fc9d3 to 9cc3da2 Compare October 20, 2026 13:28
@stferraro
stferraro force-pushed the 19.0-mig-payroll_account branch from 9cc3da2 to ef16a76 Compare October 20, 2026 14:43
@stferraro

Copy link
Copy Markdown
Contributor Author

Hi @nimarosa, thanks again for the review.

I rebased this PR onto the current 19.0 and squashed it into a single [MIG] commit.

While comparing with #294 (@amincheloh), which migrates the same module, I took three improvements from it and credited them in the commit message:

  • Copy analytic_account_id (not only journal_id) when a contract template is applied, so the analytic account is no longer dropped.
  • Show the analytic account and the salary journal on the employee form, since in 19.0 the contract data is edited from there.
  • Use primary_bank_account_id in _get_partner_id(); hr.employee.bank_account_id no longer exists in 19.0.

This PR was already approved, so could you check that the CI is green and merge it? @amincheloh, thanks for the ideas. I would be glad to coordinate if you see anything else worth bringing here.

@stferraro
stferraro requested a review from nimarosa October 20, 2026 14:58

@lumina-system-git lumina-system-git left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oca-cla-bot

oca-cla-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.