Skip to content

[19.0][FIX] hr: backfill NULL audit dates + cleanup obsolete hr_contract fields/views#47

Open
dnplkndll wants to merge 2 commits into
19.0from
19.0-fix-hr-null-write-date
Open

[19.0][FIX] hr: backfill NULL audit dates + cleanup obsolete hr_contract fields/views#47
dnplkndll wants to merge 2 commits into
19.0from
19.0-fix-hr-null-write-date

Conversation

@dnplkndll
Copy link
Copy Markdown

Migration work on the ledoent/OpenUpgrade fork (internal review).

@dnplkndll dnplkndll force-pushed the 19.0-fix-hr-null-write-date branch 2 times, most recently from 1fdee36 to 0a317d6 Compare May 30, 2026 02:26
… views

After the hr_contract → hr apriori merge, two classes of stale records
linger and trip cross-cutting view validation later in the migration:

1. ir_model_fields rows + orphan ir_ui_view records for fields the 18.0
   hr_contract module added to hr.employee that no longer exist in 19.0:
   contract_id, contract_ids, contract_warning, first_contract_date,
   vehicle (listed DEL in upgrade_analysis_work.txt as "# NOTHING TO DO"),
   plus contract_template_id, contract_type_id, contract_wage,
   contracts_count, is_in_contract (not flagged by the analyzer but
   verified stale via grep against all 19.0 hr* modules).

2. ir_ui_view records whose xml_ids were auto-renamed by openupgradelib
   (`<orig_name>_openupgrade_<id>`) during the merge to avoid xml_id
   collision. Two such views exist after the merge:
   res_config_settings_view_form_openupgrade_65293 and
   hr_departure_wizard_view_form_openupgrade_65294. Their arch_db still
   references 18.0-only xpath targets (e.g. //block[@name='employee_rights_setting_container'])
   and parents that 19.0 doesn't ship.

Both classes manifest as a migration crash when l10n_ae's
account_tax_report_data.xml triggers global view validation around
module 217/608 — without this patch the migration fails with either
"Field 'first_contract_date' does not exist in model 'hr.employee'"
or "Element '<xpath expr=...>' cannot be located in parent view".

Add two helpers in pre-migration:
 - cleanup_obsolete_hr_employee_fields(env)
 - cleanup_openupgrade_renamed_hr_views(env)

Update upgrade_analysis_work.txt: the "# NOTHING TO DO" block for the
DEL fields becomes "# DONE: stale ir_model_fields rows + orphan
ir_ui_view records cleaned up in pre-migration".
@dnplkndll dnplkndll changed the title [OU-IMP] hr: backfill NULL audit dates on hr_employee [19.0][FIX] hr: backfill NULL audit dates + cleanup obsolete hr_contract fields/views May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant