Skip to content

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

Open
aurelien-tempo wants to merge 1 commit into
OCA:17.0from
aurelien-tempo:17.0
Open

[17.0][FIX] don't set install_filename when loading views from openupgrade_scripts#5754
aurelien-tempo wants to merge 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants