Skip to content

[20.0][OU-ADD] hr_attendance: migration scripts - #167

Draft
dnplkndll wants to merge 1 commit into
20.0from
20.0-mig-hr_attendance
Draft

dnplkndll wants to merge 1 commit into
20.0from
20.0-mig-hr_attendance

Conversation

@dnplkndll

Copy link
Copy Markdown

post-migration.py

Carry whether extra hours need approving into 20.0's wider question.

19.0 asked no_validation or by_manager. 20.0 asks no_validation,
manual_validation or tolerance_validation, under a new name and so in a new
column that takes the default. A company that required a manager to approve
extra hours therefore comes out approving them automatically, and nothing
says so: the setting is not shown as empty, it is shown as the other answer.

Only by_manager is written. no_validation is already what the default gives,
and tolerance_validation is 20.0's new middle ground, which no 19.0 database
can have chosen.

tests

A migration test pins the rules above against data constructed on 19.0 before the upgrade runs:

  • openupgrade_scripts/scripts/hr_attendance/tests/data_hr_attendance_migration.py
  • openupgrade_scripts/scripts/hr_attendance/tests/test_hr_attendance_migration.py

CI: red until #118 lands

The test job fails on duplicate key value violates unique constraint "res_country_state_name_code_uniq" (Ladakh / Odisha). Not this branch:
base's pre-migration, which renames those two external ids, lives in #118 and
is not on 20.0 yet, so every branch cut from 20.0 alone hits it. Per the
fork's model the per-PR check is the lean one; the real migration gate is the
integration branch (#120), where all of this runs green over the full
585-module seed.

AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.

### post-migration.py

Carry whether extra hours need approving into 20.0's wider question.

19.0 asked no_validation or by_manager. 20.0 asks no_validation,
manual_validation or tolerance_validation, under a new name and so in a new
column that takes the default. A company that required a manager to approve
extra hours therefore comes out approving them automatically, and nothing
says so: the setting is not shown as empty, it is shown as the other answer.

Only by_manager is written. no_validation is already what the default gives,
and tolerance_validation is 20.0's new middle ground, which no 19.0 database
can have chosen.

Assisted-by: Claude Opus 5
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