Skip to content

[19.0][OU-FIX] hr_expense: move the sheet chatter to the expenses - #6115

Open
JordiBForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-hr_expense-sheet-chatter
Open

JordiBForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-hr_expense-sheet-chatter

Conversation

@JordiBForgeFlow

Copy link
Copy Markdown
Member

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

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.
@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels Nov 23, 2026

@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.

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

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

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants