Commit c0c924a
committed
[FIX] dms_field: make template root directory creation idempotent
Changed files:
- dms_field/models/dms_field_template.py
- dms_field/static/src/views/dms_list/dms_list_controller.esm.js
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.1 parent 6da9585 commit c0c924a
2 files changed
Lines changed: 36 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
82 | 103 | | |
83 | 104 | | |
84 | 105 | | |
85 | 106 | | |
86 | 107 | | |
87 | 108 | | |
88 | 109 | | |
89 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
90 | 113 | | |
91 | 114 | | |
92 | 115 | | |
| |||
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
82 | 93 | | |
83 | 94 | | |
| 95 | + | |
84 | 96 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| |||
0 commit comments