← Back to Pull requests

[FIX] dms: User with no access cannot CRUD #533

Merged
SirPyTech merged 5 files (134 lines) on Nov 09, 2026 17:50 UTC
View on GitHub
SirPyTech SirPyTech commented on Oct 28, 2026 14:37 UTC
Author

During the migration to 18.0 (https://github.com/OCA/dms/commit/1f08ada7270f879d81a26f66b1676cca5406c0e9) the override of dms.security.mixin._filter_access_rules_python was somehow substituted by a few filtered methods that all try to keep the old behavior: use SQL and the search overrides to apply the directory permissions instead of Python code.
Among others, this override was added:

    def filtered_domain(self, domain):
        """This method is needed to inhibit the behavior when called from the
        _check_access() method with sudo() https://github.com/odoo/odoo/blob/fc737a147b9aefbd6ae5d111835ce3f4f7b4240a/odoo/models.py#L4465.
        It would cause the error that multiple records are not accessed to be
        displayed.
        The _filtered_access() method is also overwritten to prevent this sudo()
        specific behavior and to be able to access only the appropriate records.
        """
        if self.env.su:
            return self
        return super().filtered_domain(domain)

Despite the explanation and the reference, I think this makes little sense simply because when filtering with sudo, the domain is not used.

This causes the failure of the use-case in the added test: if a user has no access to a directory, for them the directory's permission fields are all False.
Before this change, the test fails with
<pre>
ERROR devel odoo.addons.dms.tests.test_directory: FAIL: DirectoryTestCaseBase.test_user_no_permission
Traceback (most recent call last):
File "/opt/odoo/auto/addons/dms/tests/test_directory.py", line 299, in test_user_no_permission
self.assertFalse(directory.permission_read)
AssertionError: True is not false
</pre>

Diff: 134 lines (+73 / -61) across 5 files Reviewer: OCA-git-bot Review duration: 17473m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.38) × (1 − Review Confidence (0.65)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.38 · 134 lines diff across 5 files
0.38
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.47 · 1 substantive comment(s)
0.47
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
64%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.293
Real PR Conversation Timeline
1 comments
"Review active on #533"
general weight: 0.35
Reviewers
Assignees
SirPyTech SirPyTech
Labels
risk: low confidence: 64.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 38.2% (MEDIUM) · Higher = larger blast radius
38.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 64.7% · Lower = rushed or shallow review
64.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 13.5% · Safe to merge
13.5%
Repository