Skip to content

[17.0][FIX] auditlog: fix caching; [ADD] test_auditlog - #3373

Merged
OCA-git-bot merged 3 commits into
OCA:17.0from
StefanRijnhart:17.0-auditlog-fix-cache_sanitation
Oct 1, 2025
Merged

OCA-git-bot merged 3 commits into
OCA:17.0from
StefanRijnhart:17.0-auditlog-fix-cache_sanitation

Conversation

@StefanRijnhart

Copy link
Copy Markdown
Member

Port of #3371

Fix caching and add a dedicated test module to run tests on the accounting models.

Fixes creating credit notes with audit rules on account.move.line, writing taxes on products as a user that does not have access to all companies for which there are taxes on the product, and more.

Fixes #3308, #3224, #2561, #2554

Includes a port of #3364.

@StefanRijnhart StefanRijnhart added this to the 17.0 milestone Sep 16, 2025
@StefanRijnhart
StefanRijnhart force-pushed the 17.0-auditlog-fix-cache_sanitation branch from e150221 to a936a1d Compare September 16, 2025 14:31
@StefanRijnhart
StefanRijnhart marked this pull request as draft September 16, 2025 16:07
@StefanRijnhart
StefanRijnhart force-pushed the 17.0-auditlog-fix-cache_sanitation branch 2 times, most recently from fff8e4d to 7cee60f Compare September 16, 2025 19:41
@StefanRijnhart
StefanRijnhart marked this pull request as ready for review September 16, 2025 19:47
Though TransactionCase rolls back database changes, it does not
call `unlink` on `auditlog.rule` records, meaning that `unsubscribe`
is never called to unpatch model methods. This causes subsequent
tests in other modules to unexpectedly execute patched methods.

This commit adds the `AuditLogRuleCommon` test class in an
attempt to identify and prevent patched methods from contaminating
the test environment.
@StefanRijnhart
StefanRijnhart force-pushed the 17.0-auditlog-fix-cache_sanitation branch from 7cee60f to b77880f Compare September 24, 2025 17:30

@LoisRForgeFlow LoisRForgeFlow left a comment

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.

LGTM 👍

@LoisRForgeFlow

Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-3373-by-LoisRForgeFlow-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit cae7cbc into OCA:17.0 Oct 1, 2025
9 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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