Skip to content

[16.0] Fix inheritance of server env techname mixin#232

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
grindtildeath:16.0-fix-server_env_mixin_inheritance
Jun 10, 2025
Merged

[16.0] Fix inheritance of server env techname mixin#232
OCA-git-bot merged 1 commit intoOCA:16.0from
grindtildeath:16.0-fix-server_env_mixin_inheritance

Conversation

@grindtildeath
Copy link
Copy Markdown
Contributor

In case a model was inheriting both server.env.mixin and server.env.techname.mixin the value of _server_env_section_name_field was depending on the order in which the mixins were inherited on that model.

If server.env.mixin was inherit first as in:
_name = "my.model"
_inherit = ["my.model", "server.env.mixin", "server.env.techname.mixin"]

Then the value of _server_env_section_name would be name

If server.env.techname.mixin was inherit first as in: _name = "my.model"
_inherit = ["my.model", "server.env.techname.mixin", "server.env.mixin"]

Then the value of _server_env_section_name would be tech_name

To avoid this, since the server.env.techname.mixin changes an attribute of server.env.mixin, server.env.techname.mixin must inherit the server.env.mixin.

With this, only one of the mixins needs to be inherited and there cannot be any 'silent' issue, where the _server_env_section_name depends on the order on which mixins are inherited.

In case a model was inheriting both server.env.mixin and server.env.techname.mixin
the value of _server_env_section_name_field was depending on the order
in which the mixins were inherited on that model.

If server.env.mixin was inherit first as in:
_name = "my.model"
_inherit = ["my.model", "server.env.mixin", "server.env.techname.mixin"]

Then the value of _server_env_section_name would be `name`

If server.env.techname.mixin was inherit first as in:
_name = "my.model"
_inherit = ["my.model", "server.env.techname.mixin", "server.env.mixin"]

Then the value of _server_env_section_name would be `tech_name`

To avoid this, since the server.env.techname.mixin changes an attribute of server.env.mixin,
server.env.techname.mixin must inherit the server.env.mixin.

With this, only one of the mixins needs to be inherited and there cannot
be any 'silent' issue, where the _server_env_section_name depends on the
order on which mixins are inherited.
@grindtildeath
Copy link
Copy Markdown
Contributor Author

ping @simahawk

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

@simahawk
Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-232-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ffa31a1 into OCA:16.0 Jun 10, 2025
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at f3bf73f. 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.

6 participants