Skip to content

[19.0][FIX] upgrade_analysis: don't reset foreign-module fields on moved noupdate records#3677

Merged
OCA-git-bot merged 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-upgrade_analysis-avoid-foreign-field
Jul 21, 2026
Merged

[19.0][FIX] upgrade_analysis: don't reset foreign-module fields on moved noupdate records#3677
OCA-git-bot merged 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-upgrade_analysis-avoid-foreign-field

Conversation

@MiquelRForgeFlow

@MiquelRForgeFlow MiquelRForgeFlow commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

When a noupdate record is moved to another module, its previous definition may set a field declared in a module the new one doesn't depend on (e.g. a module that depends on it). That field is still managed by its own module, so skip it instead of resetting it to its default in the new module's noupdate_changes.xml.

Fixes #3671.

Detected in OCA/OpenUpgrade#5828 (in hr_holidays module, in holiday_status_extra_hours xmlid, that comes from hr_holidays_attendance).

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @StefanRijnhart, @legalsylvain,
some modules you are maintaining are being modified, check this out!

@pedrobaeza pedrobaeza added this to the 19.0 milestone Jul 16, 2026
@pedrobaeza
pedrobaeza requested a review from hbrunn July 16, 2026 10:55
@StefanRijnhart

StefanRijnhart commented Jul 19, 2026

Copy link
Copy Markdown
Member

That is not the correct use of Fixes in the commit message if I understand correctly. You can say, 'issue introduced in' or 'regression of', and then preferably refer to the PR #3671 rather than the commit.

@MiquelRForgeFlow

Copy link
Copy Markdown
Contributor Author

Ok, fixed PR message, by referencing the PR instead of the commit.

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

please amend test_analyze with some data and probably a patch on the fields to cover most of the code introduced here

Comment thread upgrade_analysis/models/upgrade_analysis.py Outdated
Comment thread upgrade_analysis/models/upgrade_analysis.py Outdated
Comment thread upgrade_analysis/models/upgrade_analysis.py Outdated
Comment thread upgrade_analysis/tests/test_module.py Outdated
@MiquelRForgeFlow
MiquelRForgeFlow force-pushed the 19.0-fix-upgrade_analysis-avoid-foreign-field branch from 13c0afc to 155b8b9 Compare July 21, 2026 08:37
…update records

When a noupdate record is moved to another module, its previous definition may set a field declared in a module the new one doesn't depend on (e.g. a module that depends on it). That field is still managed by its own module, so skip it instead of resetting it to its default in the new module's noupdate_changes.xml.
…anged

When a noupdate field set in the previous version is dropped in the current one, only write the reset to noupdate_changes.xml if the value a fresh install would give the field actually differs from the previous value. Otherwise the (noupdate) record already holds the right value and the entry is a no-op.
@MiquelRForgeFlow
MiquelRForgeFlow force-pushed the 19.0-fix-upgrade_analysis-avoid-foreign-field branch from 155b8b9 to d3168b0 Compare July 21, 2026 08:39
@MiquelRForgeFlow
MiquelRForgeFlow requested a review from hbrunn July 21, 2026 08:42
@hbrunn

hbrunn commented Jul 21, 2026

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 19.0-ocabot-merge-pr-3677-by-hbrunn-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 2c035f9 into OCA:19.0 Jul 21, 2026
6 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at bbe30db. Thanks a lot for contributing to OCA. ❤️

@MiquelRForgeFlow
MiquelRForgeFlow deleted the 19.0-fix-upgrade_analysis-avoid-foreign-field branch July 21, 2026 09:26
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.

5 participants