Repository navigation
[19.0][OU-FIX] hr_expense: move the sheet chatter to the expenses - #6115
Open
JordiBForgeFlow wants to merge 2 commits into
Open
JordiBForgeFlow wants to merge 2 commits into
JordiBForgeFlow wants to merge 2 commits into
Conversation
hr.expense.sheet is removed in 19.0. Post a message and schedule an activity on a sheet, and check that both are found on its expense after the migration.
hr.expense.sheet is removed in 19.0, but its messages, attachments, followers and activities kept pointing to it. The history of the sheets was no longer visible anywhere, and the activities of the removed model broke the activity overview of every user. Move them to the first expense of each sheet, and drop the activities of sheets without expenses.
pedrobaeza
requested changes
Nov 23, 2026
pedrobaeza
left a comment
Member
There was a problem hiding this comment.
I don't think we should duplicate the relational data of the sheets to each of the child expenses. It provokes a lot of noise and confusion, and maybe some side effects.
This branch has not been deployed
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.
hr.expense.sheet is removed in 19.0, but its messages, attachments, followers and
activities kept pointing to it. The history of the sheets was no longer visible
anywhere, and the activities of the removed model broke the activity overview of every
user who had one (KeyError: 'hr.expense.sheet').
This moves them to the first expense of each sheet (followers already following that
expense are dropped), and drops the activities of sheets without expenses. The
migration test checks that a message and an activity posted on a sheet end up on its
expense.
Checked on a production database: 3,540 messages, 274 attachments, 267 followers and
307 activities moved, and the activity overview loads again.
Note: OCA/hr-expense#378 (hr_expense_sheet) brings the sheets back as a separate
module. If it should also restore the sheet chatter, it can find it on the first
expense of each former_sheet_id.
The first commit adds the test: it fails without the fix (the message no longer
points to any model) and passes with it.
Assisted by AI