Skip to content

[16.0][OU-ADD] hr: name empty-named employees before create_work_contact#6

Open
eantones wants to merge 1 commit into
16.0from
16.0-apriori-merges
Open

[16.0][OU-ADD] hr: name empty-named employees before create_work_contact#6
eantones wants to merge 1 commit into
16.0from
16.0-apriori-merges

Conversation

@eantones

@eantones eantones commented Jul 6, 2026

Copy link
Copy Markdown
Member

Engine patch for the 15→16 hop (same vehicle as #3 for 14→15; informative, never for OCA upstream).

The 16.0 hr post-migration (create_work_contact) 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).

The new pre-00-hr-employee-empty-names.py (basename sorts before hr's own pre-migration.py) gives such employees a deterministic non-empty name: 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 is fixed first.

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.
@eantones eantones added the oca-candidate Contains commits of ours that will be proposed to OCA at submit time. label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oca-candidate Contains commits of ours that will be proposed to OCA at submit time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant