Skip to content

[18.0][REF] auditlog et al: adapt to new Odoo test patch checker#3526

Merged
OCA-git-bot merged 11 commits intoOCA:18.0from
StefanRijnhart:18.0-auditlog-adapt_to_test_patch_checker
Feb 20, 2026
Merged

[18.0][REF] auditlog et al: adapt to new Odoo test patch checker#3526
OCA-git-bot merged 11 commits intoOCA:18.0from
StefanRijnhart:18.0-auditlog-adapt_to_test_patch_checker

Conversation

@StefanRijnhart
Copy link
Member

@StefanRijnhart StefanRijnhart commented Feb 19, 2026

Requires

See odoo/odoo#247151

Fixes in auditlog:

  • Register with the patch checker to prevent exhaustive logging
odoo odoo.tests.common: /__w/server-tools/server-tools/auditlog/models/rule.py:232:_patch_method setting res.groups.unlink to <function AuditlogRule._make_unlink.<locals>.unlink_full at 0x7fa51ea90f70>

Fixes in other modules:

  • Make sure patches or registry updates happen in setUp, not setUpClass and are properly cleaned.

@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch from cdbf84a to 7e20cd7 Compare February 19, 2026 09:41
@StefanRijnhart StefanRijnhart changed the title [18.0][REF] auditlog: adapt to new Odoo test patch checker [18.0][REF] auditlog et al: adapt to new Odoo test patch checker Feb 19, 2026
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch from e6e40a3 to c11af6b Compare February 19, 2026 13:18
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch 2 times, most recently from f47d7b9 to 3e803b5 Compare February 19, 2026 14:32
@StefanRijnhart StefanRijnhart marked this pull request as draft February 19, 2026 14:55
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch 2 times, most recently from 1b557ac to bcec7d8 Compare February 20, 2026 08:27
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch from 869d84f to 9d0e595 Compare February 20, 2026 08:47
See odoo/odoo#247151

* Register with the patch checker to prevent exhaustive logging

```
odoo odoo.tests.common: /__w/server-tools/server-tools/auditlog/models/rule.py:232:_patch_method setting res.groups.unlink to <function AuditlogRule._make_unlink.<locals>.unlink_full at 0x7fa51ea90f70>
```

* Align model patching with how it's done in base_automation to fully remove
  patched methods. Fixes OCA#3439
* Dismantle own patch checker.
* Ensure no patching takes place in setUpClass.
See odoo/odoo#247151

Fixes
```
AssertionError: Found unexpected attributes on res.partner: _default_batch_size
```
See odoo/odoo#247151

Fixes
```
AssertionError: Found unexpected attributes on res.partner.category: jsonify_custom
```
Replace manual monkeypatching with unittest.mock.patch which is not signalled
by Odoo's patch checker.

See odoo/odoo#247151
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch from 131bd3d to 984df5d Compare February 20, 2026 09:11
@StefanRijnhart StefanRijnhart marked this pull request as ready for review February 20, 2026 09:11
@pedrobaeza pedrobaeza added this to the 18.0 milestone Feb 20, 2026
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auditlog-adapt_to_test_patch_checker branch from 984df5d to cd16a58 Compare February 20, 2026 09:41
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.

Let's try to greenify everything involved in the new "pocalypse" (how do we call it? FakeModelLoaderpocalypse?

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 0083183 into OCA:18.0 Feb 20, 2026
2 of 4 checks passed
@OCA-git-bot
Copy link
Contributor

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

Auditlog: Patching Causes Failures in Other Unit Tests

3 participants