Skip to content

[MIG] hr_holidays_ux: Migration to 20.0 - #73

Closed
les-adhoc wants to merge 3 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76763-les
Closed

les-adhoc wants to merge 3 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76763-les

Conversation

@les-adhoc

@les-adhoc les-adhoc commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Tarea: https://www.adhoc.inc/odoo/project.task/76763

What changes

  • hr.leave.type is merged into hr.work.entry.type in 20.0: pre_approved_instance and its form view move there (inherits hr_holidays.hr_work_entry_type_view_form).
  • hr.leave.holiday_status_id is now work_entry_type_id.
  • request_unit_half / request_unit_hours were removed in 20.0: dropped from the fields copied on split.
  • Pre-approval moves to _action_validate, the only core path that validates a leave. The old action_validate override never ran (the core has no such method) and action_approve failed on more than one leave.
  • Time rules: pre-approved leaves are validated with skip_time_rules; the rules run in action_post_approve, after the resource leave exists.
  • Attachment in pre-validate: the 20.0 behavior is kept (product decision). The document is attached through the chatter, which counts as a supported attachment and shows the Approve button. No view override for the attachment field.
  • Allocation multi wizard: follows the 20.0 core method (_get_employees_from_allocation_mode was removed, new accrual init), still without the automatic approval. With a duration set, accrual is no longer processed on creation (same as core 20.0; the 19.0 override always processed it).
  • i18n regenerated for 20.0; README with the real configuration and usage.
  • New tests (the module had none): month split on create/write, pre-approved flow, time rules on final approval, batch approval, allocation reset, multi allocation wizard.

Data

No migration script. The only production database with the module has no time off type with pre_approved_instance set and no leave in pre-validate, so there is nothing to carry over. To be revisited if a real case appears.

Open points

  • action_post_approve calls _validate_leave_request() again after the pre-approval already did it (same as 19.0). To review apart from this migration.

Test plan

  • Installed on a 20.0 database with demo data (core of 2026-10-14).
  • --test-tags /hr_holidays_ux: 0 failed, 0 error(s) of 13 tests; the new tests fail with the previous code.
  • pre-commit passes. upgrade_code scripts: none applies to this module.
  • Not tested on an upgraded database: runbot does not run the 19.0→20.0 upgrade yet (https://www.adhoc.inc/odoo/project.task/77184).

- hr.leave.type is merged into hr.work.entry.type: move
  pre_approved_instance and its form view there.
- hr.leave.holiday_status_id is now work_entry_type_id.
- Drop request_unit_half/request_unit_hours, removed in 20.0.
- supported_attachment_ids is only in the dashboard form in 20.0:
  move the visibility override there.
- Allocation multi wizard: follow the 20.0 core method, still
  without the automatic approval.
- Add tests for month split, pre-approved flow, allocation reset
  and the multi allocation wizard.
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

… final approval

- Move the pre-approval logic from action_approve/action_validate to
  _action_validate. action_validate does not exist in the core, so that
  override never ran, and action_approve did not pass check_state and
  failed when approving several leaves at once.
- Pre-approved leaves are validated with skip_time_rules; time rules run
  in action_post_approve, after the resource leaves exist.
- Anchor the attachment xpath on the div that wraps the field in 20.0.
- Regenerate i18n (references to hr.work.entry.type) and translate the
  empty terms.
- README: real configuration and usage, drop the runbot badge.
…oard form

The PO chose the 20.0 behavior: in Pre-Approved the supporting document
is attached through the chatter, which already counts as a supported
attachment and shows the Approve button. The form keeps the core rule
(attachment field only while the leave is To Approve).
@les-adhoc les-adhoc changed the title [WIP] [MIG] hr_holidays_ux: Migration to 20.0 [MIG] hr_holidays_ux: Migration to 20.0 Oct 15, 2026
@jcadhoc

jcadhoc commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump rebase-ff

@roboadhoc

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward.

roboadhoc pushed a commit that referenced this pull request Oct 16, 2026
- hr.leave.type is merged into hr.work.entry.type: move
  pre_approved_instance and its form view there.
- hr.leave.holiday_status_id is now work_entry_type_id.
- Drop request_unit_half/request_unit_hours, removed in 20.0.
- supported_attachment_ids is only in the dashboard form in 20.0:
  move the visibility override there.
- Allocation multi wizard: follow the 20.0 core method, still
  without the automatic approval.
- Add tests for month split, pre-approved flow, allocation reset
  and the multi allocation wizard.

Part-of: #73
Signed-off-by: Juan Carreras <[email protected]>
roboadhoc pushed a commit that referenced this pull request Oct 16, 2026
… final approval

- Move the pre-approval logic from action_approve/action_validate to
  _action_validate. action_validate does not exist in the core, so that
  override never ran, and action_approve did not pass check_state and
  failed when approving several leaves at once.
- Pre-approved leaves are validated with skip_time_rules; time rules run
  in action_post_approve, after the resource leaves exist.
- Anchor the attachment xpath on the div that wraps the field in 20.0.
- Regenerate i18n (references to hr.work.entry.type) and translate the
  empty terms.
- README: real configuration and usage, drop the runbot badge.

Part-of: #73
Signed-off-by: Juan Carreras <[email protected]>
@roboadhoc roboadhoc closed this in d4457c9 Oct 16, 2026
@roboadhoc
roboadhoc deleted the 20.0-t-76763-les branch October 16, 2026 11:44
@roboadhoc roboadhoc added the 19.1 label Oct 16, 2026

This branch was previously deployed

1 inactive deployment
merge — 93318f93 Deployed Oct 16, 2026 by roboadhoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants