Skip to content

[17.0][FIX] don't set install_filename when loading views from openupgrade_scripts#5754

Merged
pedrobaeza merged 1 commit into
OCA:17.0from
aurelien-tempo:17.0
Jun 30, 2026
Merged

[17.0][FIX] don't set install_filename when loading views from openupgrade_scripts#5754
pedrobaeza merged 1 commit into
OCA:17.0from
aurelien-tempo:17.0

Conversation

@aurelien-tempo

Copy link
Copy Markdown

Backport changes from #5445 on 18.0 to OpenUpgrade 17.0 through a cherry-pick of the commit from 18.0.
As commented in #5437, I got the issue when migrating the portal module from 16.0 to 17.0.
Cherry-picking the commit on local fixed the issue for me.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:17.0 mod:openupgrade_framework Module openupgrade_framework labels Jun 26, 2026
path_info = get_resource_from_path(self._context["install_filename"])
if path_info[0] == "openupgrade_scripts":
self = self.with_context(
**{k: v for k, v in self._context.items() if k != "install_filename"}

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.

this makes this monkey patch basically a no-op. remove this commit, then with what you did just now you should be fine

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you, I didn't understand that exploding it like suggested by the Pylint warning would change the behavior when removing elements from the context. I reverted the change and disabled the warning.

@aurelien-tempo

Copy link
Copy Markdown
Author

Changes done. I can squash before or after approval, as you prefer @hbrunn .

@hbrunn

hbrunn commented Jun 29, 2026

Copy link
Copy Markdown
Member

please do the squashing

…scripts

fixes OCA#5437

Changes compared to 527770f:
- use a view from a 17.0.x noupdate_changes.xml file instead of a 18.0.x one in unit test
- disable pylint warning due to voluntary context override
@pedrobaeza pedrobaeza added this to the 17.0 milestone Jun 30, 2026
@pedrobaeza pedrobaeza merged commit f0257a9 into OCA:17.0 Jun 30, 2026
4 checks passed
@pedrobaeza

Copy link
Copy Markdown
Member

This contains a bug fixed in #5764

@aurelien-tempo

Copy link
Copy Markdown
Author

I didn't see the fix that was already in the 18.0 and 19.0 branches, sorry

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

Labels

approved mod:openupgrade_framework Module openupgrade_framework mod:openupgrade_scripts Module openupgrade_scripts series:17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants