Skip to content

[17.0] Fix inheritance of server env techname mixin#233

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

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

Conversation

@grindtildeath
Copy link
Copy Markdown
Contributor

@grindtildeath grindtildeath commented Jun 4, 2025

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.

FW Port:

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 grindtildeath changed the title Fix inheritance of server env techname mixin [17.0] Fix inheritance of server env techname mixin Jun 4, 2025
@simahawk
Copy link
Copy Markdown
Contributor

/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 17.0-ocabot-merge-pr-233-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 1dae0ff into OCA:17.0 Jun 12, 2025
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

4 participants