Skip to content

[18.0][FIX] base_comment_template: fix tests#1142

Merged
OCA-git-bot merged 1 commit intoOCA:18.0from
qrtl:18.0-fix-tests-base_comment_template
Mar 13, 2026
Merged

[18.0][FIX] base_comment_template: fix tests#1142
OCA-git-bot merged 1 commit intoOCA:18.0from
qrtl:18.0-fix-tests-base_comment_template

Conversation

@AungKoKoLin1997
Copy link
Contributor

Odoo 18 introduced stricter test validation (odoo/odoo@de056cc#diff-80aef099e5fb41cc09e699d35b749152aca50caf5b0bc16c400081c29023fbec) that checks for unexpected attributes added to models during tests. Our tests extend the existing res.users model with the comment.template mixin, which adds comment_template_ids and causes AssertionError: Found unexpected attributes on res.users: comment_template_ids.

I fixed by registering the mixin attribute using classPatch(). If anyone has a cleaner solution, suggestions are welcome!

@qrtl QT6451

Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

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

Confirmed locally that the patch fixes the test error.

super().setUpClass()
setup_test_model(cls.env, ResUsers)
res_users_model = cls.env.registry["res.users"]
# Register the comment_template_ids field added by comment.template mixin
Copy link
Member

Choose a reason for hiding this comment

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

We may add a reference to odoo/odoo#247151 to provide more context.

@pedrobaeza pedrobaeza added this to the 18.0 milestone Mar 13, 2026
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 1012448 into OCA:18.0 Mar 13, 2026
7 checks passed
@OCA-git-bot
Copy link
Contributor

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