[18.0][FIX] dms_field: make template root directory creation idempotent #501
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.50) × (1 − Review Confidence (0.42)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 116 lines diff across 1 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.285
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #501"
general
weight: 0.35
DealTechSrl
Issue: https://github.com/OCA/dms/issues/500
Changed files:
Root cause:
When initializing the Documents tab of a dms.field.template, the backend created the template root directory, but repeated calls to create_dms_directory() could try to create the same root again, causing:
"A directory with the same name already exists."
The created directory could also be missing template access groups, making it invisible to regular users. On the frontend, the DMS widget relied on cached dms_directory_ids, so a newly created template root directory could exist in the database but not appear immediately in the tree.
Solution:
Make dms.field.template root directory creation idempotent, keep access groups aligned with the template, and adjust the widget domain so the created root can be displayed after refresh.