Skip to content

[19.0][OU-IMP] hr_expense: hr_expense_sheet compatibility - #5917

Closed
victoralmau wants to merge 1 commit into
OCA:19.0from
Tecnativa:18.0-ou-imp-hr_expense-hr_expense_sheet
Closed

[19.0][OU-IMP] hr_expense: hr_expense_sheet compatibility#5917
victoralmau wants to merge 1 commit into
OCA:19.0from
Tecnativa:18.0-ou-imp-hr_expense-hr_expense_sheet

Conversation

@victoralmau

Copy link
Copy Markdown
Member

hr_expense_sheet compatibility

Related to OCA/hr-expense#378

@Tecnativa TT58631

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels Aug 19, 2026
@victoralmau victoralmau changed the title [19.09][OU-IMP] hr_expense: hr_expense_sheet compatibility [19.0][OU-IMP] hr_expense: hr_expense_sheet compatibility Aug 19, 2026
@victoralmau
victoralmau force-pushed the 18.0-ou-imp-hr_expense-hr_expense_sheet branch 3 times, most recently from 6b9f63c to a3ee6f0 Compare August 19, 2026 07:31
@MiquelRForgeFlow MiquelRForgeFlow added this to the 19.0 milestone Aug 19, 2026
@MiquelRForgeFlow

Copy link
Copy Markdown
Contributor

@victoralmau please, rebase. I made an error when force pushing to 19.0 (it's already amended)

@victoralmau
victoralmau force-pushed the 18.0-ou-imp-hr_expense-hr_expense_sheet branch from a3ee6f0 to ed39bb7 Compare August 19, 2026 12:38
Comment thread openupgrade_scripts/scripts/hr_expense/19.0.2.1/post-migration.py Outdated
Comment thread openupgrade_scripts/scripts/hr_expense/19.0.2.1/post-migration.py Outdated
@victoralmau
victoralmau force-pushed the 18.0-ou-imp-hr_expense-hr_expense_sheet branch from ed39bb7 to 95012f4 Compare August 21, 2026 14:38
@victoralmau
victoralmau force-pushed the 18.0-ou-imp-hr_expense-hr_expense_sheet branch from 95012f4 to 966a21e Compare August 21, 2026 14:54

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does any of this happen in hr_expense's migration, and not in the pre-init script of hr_expense_sheet?


hr_expense / hr.expense / untaxed_amount (float) : NEW isfunction: function, stored

# DONE: hr_expense_sheet compatibility

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what has this column to do with the above?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am referring to everything that comes after that: hr.expense.sheet

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so put it after what you're referring to

@victoralmau

Copy link
Copy Markdown
Member Author

why does any of this happen in hr_expense's migration, and not in the pre-init script of hr_expense_sheet?

Why can't it be in OpenUpgrade?

There are several reasons why I believe it SHOULD be here:

  • It is “difficult” for someone who has used Odoo and hr.expense.sheet before 19.0 to stop using that functionality; reporting ‘grouped’ expenses (and reviewing them) without that option is “very difficult.”
  • Modifying data in tables that will no longer be used in Odoo core has no side effects; in my opinion, it’s unnecessary to add logic to hr_expense_sheet to perform that renaming when OpenUpgrade already does it in hr_expense.

@hbrunn

hbrunn commented Aug 25, 2026

Copy link
Copy Markdown
Member

I think it just doesn't belong to this migration script because people won't necessary use hr_expense_sheet. And technically, it's not difficult to detect on installation of that module if you're coming from an ex-v18 version, so I don't see a reason to have unrelated code in the migration script of hr_expense

@victoralmau

Copy link
Copy Markdown
Member Author

@pedrobaeza and @MiquelRForgeFlow What do you think about this?

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a fact that both OpenUpgrade and OCA hr_expense_sheet initialization are depending each other, as if you migrate with enterprise, you won't find the expected columns (it removes them), but it's true that copying some columns, processing them or renaming them without knowing if you are going to install hr_expense_sheet is useless and time/space consuming (although we plan to install it in most installations), so let's move it to pre_init_hook as stated by Holger, and you can detect if former_sheet_id exists and then trigger in that case the rest of the code. In the module, you should also include a migration script without @openupgrade.migrate decorator importing and calling pre_init_hook.

@victoralmau

Copy link
Copy Markdown
Member Author

Moved to OCA/hr-expense#378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants