Skip to content

[FIX] hr_employee_firstname: address_home_id -> work_contact_id (V19 compat)#1581

Open
REANOVA-GIT wants to merge 1 commit into
OCA:19.0from
REANOVA-GIT:19.0-reanova-fix
Open

[FIX] hr_employee_firstname: address_home_id -> work_contact_id (V19 compat)#1581
REANOVA-GIT wants to merge 1 commit into
OCA:19.0from
REANOVA-GIT:19.0-reanova-fix

Conversation

@REANOVA-GIT
Copy link
Copy Markdown

Description

hr_employee_firstname on the 19.0 branch still references hr.employee.address_home_id, which was removed in Odoo 19 (HR refactoring — the private contact link is now work_contact_id).

Without this fix, the module crashes on a fresh V19 install / runtime as soon as _update_partner_firstname is triggered (or UPDATE_PARTNER_FIELDS is read) because address_home_id does not exist on hr.employee anymore.

Changes

- UPDATE_PARTNER_FIELDS = ["firstname", "lastname", "user_id", "address_home_id"]
+ UPDATE_PARTNER_FIELDS = ["firstname", "lastname", "user_id", "work_contact_id"]

  def _update_partner_firstname(self):
      for employee in self:
          partners = employee.mapped("user_id.partner_id")
-         partners |= employee.mapped("address_home_id")
+         partners |= employee.mapped("work_contact_id")

Context

Discovered while migrating a large Odoo V12 → V19 deployment (Reanova ERP). The patch has been running in production-like staging for several days without issue.

work_contact_id is the V18+ Odoo replacement for the V12-V17 address_home_id field on hr.employee (cf. Odoo 18 release notes — HR module overhaul).

Tests

Manual test on a V19 install with ~180 employees + partner_firstname dependency: employees update their partner records (firstname/lastname) correctly through _update_partner_firstname after this change. No regression observed on related modules (hr_employee_legal_name, etc.).

…tact_id

Odoo 19 supprime hr.employee.address_home_id (refonte HR: la fiche
contact privee n est plus liee par ce champ). Remplacer par work_contact_id
dans UPDATE_PARTNER_FIELDS + _update_partner_firstname.

Patch local Reanova migration V12->V19 - a formaliser en PR OCA.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @luisg123v, @Savoir-faire Linux,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:hr_employee_firstname Module hr_employee_firstname series:19.0 labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_employee_firstname Module hr_employee_firstname series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants