Skip to content

[18.0] Fix inheritance of server env techname mixin#234

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

[18.0] Fix inheritance of server env techname mixin#234
OCA-git-bot merged 1 commit intoOCA:18.0from
grindtildeath:18.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.

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.
can override or extend default values;
- you can override or extend values in the main configuration file of
your instance;
- values common to all / most environments can be stored in the
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.

next time, use export SKIP=oca-gen-addon-readme to disable readme updates ;)

@simahawk
Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-234-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 0a1444a into OCA:18.0 Jun 12, 2025
7 checks passed
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.

3 participants