Skip to content

[18.0] hr_holidays: Incorrect transformation query for hr_leave_allocation #5380

@CarlosMontalvo-4ce

Description

@CarlosMontalvo-4ce

Module

hr_holidays

Describe the bug

When upgrading a v17 database with archived hr_leave_allocation records to v18, the scripts transform those records to the invalid state "cancel", which crashes the view when trying to access the "allocations" menu in the hr_holidays module.

To Reproduce

[17.0 to 18.0]:

Steps to reproduce the behavior:

  1. Create Time Off assignation records and archive them on the v17 DB.
  2. Perform the upgrade.
  3. As the Administrator, go to Time Off > Management > Allocations and remove all the filters.
  4. The traceback will appear, with the error "KeyError: 'cancel'".
Image

Expected behavior
Archived hr_leave_allocation errors should stay as-is, without any transformations.

Additional context
The exact action is made by scripts/hr_holidays/18.0.1.6/pre-migration.py, from line 50 to 57

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions