[19.0][FIX] dms: record directories of records sharing a display name get unique names #542
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.34) × (1 − Review Confidence (0.44)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.34 · 19 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.179
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #542"
general
weight: 0.35
victoralmau
FWP from 18.0: https://github.com/OCA/dms/pull/539
Problem
A storage with
save_type=attachmentcreates one directory per record (ir.attachment._dms_directories_create), named afterdisplay_name. When two records have the same display name (for example two partners called the same), creating an attachment on the second one raisesValidationError: A directory with the same name already exists.The
check_name=Falsecontext only skips the character check, not the uniqueness check. This blocks any write that creates an attachment, for example creating a company whose partner has the same name as another partner.How to reproduce
1. Install
dmswith demo data; the demo has a storage linked tores.partner.2. Create an attachment on a partner.
3. Copy that partner keeping its name, then create an attachment on the copy.
4. The ValidationError is raised.
Fix
The auto-created directory now gets
unique_name(display_name, <sibling names>)fromdms/tools/file.py, the helper the module already uses for files.Tests
New
test_storage_attachment_same_record_name:Run on Odoo 18.0 in a database with only dms and its dependencies.
CLA
The author signed the OCA CLA; the commit email (marlon.costa@datacosmos.com.br) is now verified on the GitHub account marlon-costa-dc.
@Tecnativa