fix(l10n_do_banks): create the UAE work entry types hr_work_entry_attendance needs - #70
Open
erick-pcg wants to merge 1 commit into
Open
fix(l10n_do_banks): create the UAE work entry types hr_work_entry_attendance needs#70erick-pcg wants to merge 1 commit into
erick-pcg wants to merge 1 commit into
Conversation
erick-pcg
force-pushed
the
master-fix-uae_work_entry_types-ec
branch
from
September 3, 2026 14:03
9d27f54 to
d233dfb
Compare
erick-pcg
force-pushed
the
master-fix-uae_work_entry_types-ec
branch
from
September 3, 2026 14:07
d233dfb to
a8823b9
Compare
luis-pcg
approved these changes
Sep 3, 2026
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.
Summary
Adds
src/l10n_do_banks/19.0.1.0.0/pre-30-create-missing-core-work-entry-types.py, whichcreates the three UAE work entry types that
hr_work_entry_attendancereferences, so the19.0 upgrade no longer aborts while loading the registry.
Validated on the ACINT staging build (
odoo-acint-test-*), where it cleared this failure.The failure
hr_work_entry_attendanceisauto_install, so it installs itself as soon ashr_work_entryandhr_attendanceare present. Itsdata/hr_attendance_overtime_rule_data.xmlbuilds four overtime rules that point at UAEwork entry types through plain
refattributes, and none of those records carryforcecreate="0". A missing target therefore aborts the whole registry:Three distinct types are needed, not one: the four rules reference
uae_work_entry_type_overtime_work_days_daytime,..._nighttimeanduae_work_entry_type_overtime_off_days. Creating only the first one just moves the errorto the next rule.
Why the records are missing
The types are declared in
hr_work_entry/data/hr_work_entry_type_data.xml, but that fileis only replayed when
hr_work_entryitself is updated. On a database thatupgrade.odoo.comalready brought to 19.0 with an older 19.0 source, the module sits atinstalledwith a current version (confirmed:19.0.1.0), its data is never reloaded, andthe records never land -- while the newer odoo.sh source does ship the enterprise file that
needs them.
baseis not upgrading either, sobase/0.0.0/post-02-force-upgrade-installed-modules.pynever runs to force it.Why this approach
Three alternatives were ruled out by reading the loader, and are worth recording so they
are not retried:
hr_work_entryasto upgradefrom apre-script. The module graph readsir_module_module.stateonce while it is being built (odoo/modules/module_graph.py),and every non-
basepackage is already frozen by the time our scripts run. This is alsowhy the
baseforce-upgrade script works and an equivalent of ours would not.graph than
hr_work_entry_attendance, so they run after the crash. Migration scripts alsodo not fire at all in
initmode, and the module is being installed, not upgraded.util.update_record_from_xml. It requires apost-orend-script, by which pointthe registry has already failed.
That leaves a
pre-script onl10n_do_banks, which has no dependencies and is thereforeprocessed at depth 1 -- before
hr_work_entry. Raw SQL is required there becausehr.work.entry.typeis not in the registry yet. Two column details the ORM would normallyhandle:
nameis translated, so it is jsonb;round_daysandround_days_typeare NOT NULLwith no database default and are absent from the core XML, so they are copied off an existing
row instead of hardcoding selection values.
Notes
The script is idempotent: it checks
ir_model_datafirst and turns itself into a no-op oncethe records exist, so it stays harmless on databases migrated with an up-to-date source. The
ir_model_datarows are written undermodule='hr_work_entry'withnoupdate=true, matchingwhat Odoo would have created, so a later
hr_work_entryupdate finds them instead ofduplicating.
This is a patch over Odoo's own data. The underlying problem is upstream: the
hr_attendance.hr_attendance_overtime_rule_*_aerecords have noforcecreate="0", which turnsa missing datum into a downed registry rather than a warning. A support ticket is still pending.
Odoo sources
odoo/odoo@e9d15ee
https://github.com/odoo/odoo/blob/19.0/addons/hr_work_entry/data/hr_work_entry_type_data.xml#L93-L115