Skip to content

[16.0][ADD] image_tag_environment: make server_environment an optional dependency - #575

Merged
OCA-git-bot merged 2 commits into
OCA:16.0from
camptocamp:16-dr-image_tag
Aug 20, 2026
Merged

OCA-git-bot merged 2 commits into
OCA:16.0from
camptocamp:16-dr-image_tag

Conversation

@yankinmax

Copy link
Copy Markdown
Contributor

PR is aimed to remove server_environment dependency from image_tag in the scope of this issue:

"data": [
"views/image_tag.xml",
],
"auto_install": True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it enough to get it automatically installed on environments where image_tag was already instealled and it only gets an update?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added the migration script and it's safe enough. No issues in logs about fields removal or schema change.

@ivantodorovich

Copy link
Copy Markdown
Contributor

@etobella this is similar to the one you did for fs_storage #627
WDYT?

[("name", "=", "image_tag_environment"), ("state", "=", "uninstalled")]
)
if module:
module.button_install()

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.

My experience also states that it is nice to get the data and add it to the right field. This happened to me and I would recommend you to do it this way 😉

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Which data? the one set in the environment?

The purpose of this script is to install the new split off module, so instances that were configured through the environment remain configurable through env -- by having the new *_environment module automatically installed

Users or sysadmins are expected to explicitly uninstall the *_environment module and re-configure their system.

To make that easier, we're working on this approach:

It's not done in this PR, though. At this stage we want at least to have the modules split.

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.

yes, but it will give you problems when you want to remove the environment, also, it happened to me that I decided to remove the dependancy as it was not required, at that moment, everything failed as the uninstall hook did not pass.... I am just warning, it shouldn't be a big deal to handle in the migration too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't need any uninstall hook here, because image_tag_environment doesn't actually override _server_env_fields

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

For me OK, just review my comment if possible 😉

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot added series:16.0 mod:image_tag Module image_tag mod:image_tag_environment Module image_tag_environment labels Aug 19, 2026
@yankinmax

Copy link
Copy Markdown
Contributor Author

@etobella for this split case we don't need any extra uninstall hooks or UserError exceptions. No field is namaged as server env field.

@etobella

This comment has been minimized.

@lmignon lmignon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO image_tag_environment will never be migrated and disapear... I'm wondering why i put a dependency on server_environment 🤔 🙄

@lmignon

lmignon commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge major

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-575-by-lmignon-bump-major, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit d81ddc1 into OCA:16.0 Aug 20, 2026
8 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

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