[16.0][OU-ADD] hr: name empty-named employees before create_work_contact#6
Open
eantones wants to merge 1 commit into
Open
[16.0][OU-ADD] hr: name empty-named employees before create_work_contact#6eantones wants to merge 1 commit into
eantones wants to merge 1 commit into
Conversation
The 16.0 hr post-migration creates a res.partner per employee taking the partner name from the employee name. Core accepts nameless partners, but with OCA partner_firstname installed its _check_name constraint raises EmptyNamesError and the whole -u all dies (seen 2026-07-06 on a real 15->16 hop: one active employee with an empty name). Give such employees a deterministic non-empty name in a pre script that sorts before hr's own pre-migration.py by basename: work_email when available, a synthetic 'Employee #id' marker otherwise. hr_employee.name is a stored related to resource_resource.name, so the resource row (the source of truth) is fixed first.
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.
Engine patch for the 15→16 hop (same vehicle as #3 for 14→15; informative, never for OCA upstream).
The 16.0
hrpost-migration (create_work_contact) creates ares.partnerper employee taking the partner name from the employee name. Core accepts nameless partners, but with OCApartner_firstnameinstalled its_check_nameconstraint raisesEmptyNamesErrorand the whole-u alldies (seen 2026-07-06 on a real 15→16 hop: one active employee with an empty name).The new
pre-00-hr-employee-empty-names.py(basename sorts before hr's ownpre-migration.py) gives such employees a deterministic non-empty name:work_emailwhen available, a syntheticEmployee #idmarker otherwise.hr_employee.nameis a stored related toresource_resource.name, so the resource row is fixed first.