odoo-addon-dms 17.0.1.0.0.7__py3-none-any.whl → 17.0.1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/dms/README.rst +1 -1
- odoo/addons/dms/__manifest__.py +1 -1
- odoo/addons/dms/models/dms_file.py +1 -0
- odoo/addons/dms/models/dms_security_mixin.py +5 -2
- odoo/addons/dms/models/ir_attachment.py +19 -1
- odoo/addons/dms/models/storage.py +6 -0
- odoo/addons/dms/static/description/index.html +1 -1
- odoo/addons/dms/tests/test_storage_attachment.py +13 -0
- {odoo_addon_dms-17.0.1.0.0.7.dist-info → odoo_addon_dms-17.0.1.1.0.dist-info}/METADATA +2 -2
- {odoo_addon_dms-17.0.1.0.0.7.dist-info → odoo_addon_dms-17.0.1.1.0.dist-info}/RECORD +12 -12
- {odoo_addon_dms-17.0.1.0.0.7.dist-info → odoo_addon_dms-17.0.1.1.0.dist-info}/WHEEL +0 -0
- {odoo_addon_dms-17.0.1.0.0.7.dist-info → odoo_addon_dms-17.0.1.1.0.dist-info}/top_level.txt +0 -0
odoo/addons/dms/README.rst
CHANGED
@@ -7,7 +7,7 @@ Document Management System
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
8
8
|
!! changes will be overwritten. !!
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
10
|
-
!! source digest: sha256:
|
10
|
+
!! source digest: sha256:6a314d55775609f48d0cd0a6da9c801d0eb48b481cc2fe12105fcc4c57c73fe2
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
12
12
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
odoo/addons/dms/__manifest__.py
CHANGED
@@ -139,8 +139,11 @@ class DmsSecurityMixin(models.AbstractModel):
|
|
139
139
|
continue
|
140
140
|
domains.append([("res_model", "=", model._name), ("res_id", "=", False)])
|
141
141
|
# Check record access in batch too
|
142
|
-
|
143
|
-
|
142
|
+
res_ids = [i for i in group["res_id"] if i] # Hack to remove None res_id
|
143
|
+
# Apply exists to skip records that do not exist. (e.g. a res.partner
|
144
|
+
# deleted by database).
|
145
|
+
model_records = model.browse(res_ids).exists()
|
146
|
+
related_ok = model_records._filter_access_rules_python(operation)
|
144
147
|
if not related_ok:
|
145
148
|
continue
|
146
149
|
domains.append(
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# Copyright 2021 Tecnativa - Víctor Martínez
|
2
2
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
3
3
|
from odoo import api, models
|
4
|
+
from odoo.tools import ormcache
|
4
5
|
|
5
6
|
|
6
7
|
class IrAttachment(models.Model):
|
@@ -34,9 +35,26 @@ class IrAttachment(models.Model):
|
|
34
35
|
}
|
35
36
|
)
|
36
37
|
|
38
|
+
@ormcache("model")
|
39
|
+
def _dms_operations_from_model(self, model):
|
40
|
+
# Apply sudo to prevent ir.rule from being applied.
|
41
|
+
item = self.env["dms.storage"].sudo().search([("model_ids.model", "=", model)])
|
42
|
+
return bool(item)
|
43
|
+
|
37
44
|
def _dms_operations(self):
|
45
|
+
"""Perform the operation only if there is a storage with linked models.
|
46
|
+
The directory (dms.directory) linked to the record (if it does not exist)
|
47
|
+
and the file (dms.file) with the linked attachment would be created.
|
48
|
+
"""
|
38
49
|
for attachment in self:
|
39
|
-
if
|
50
|
+
if (
|
51
|
+
not attachment.res_model
|
52
|
+
or not attachment.res_id
|
53
|
+
or (
|
54
|
+
attachment.res_model
|
55
|
+
and not self._dms_operations_from_model(attachment.res_model)
|
56
|
+
)
|
57
|
+
):
|
40
58
|
continue
|
41
59
|
directories = attachment._get_dms_directories(
|
42
60
|
attachment.res_model, attachment.res_id
|
@@ -125,3 +125,9 @@ class Storage(models.Model):
|
|
125
125
|
def _compute_count_storage_files(self):
|
126
126
|
for record in self:
|
127
127
|
record.count_storage_files = len(record.storage_file_ids)
|
128
|
+
|
129
|
+
def write(self, values):
|
130
|
+
res = super().write(values)
|
131
|
+
if "model_ids" in values:
|
132
|
+
self.env.registry.clear_cache()
|
133
|
+
return res
|
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
368
368
|
!! changes will be overwritten. !!
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
370
|
-
!! source digest: sha256:
|
370
|
+
!! source digest: sha256:6a314d55775609f48d0cd0a6da9c801d0eb48b481cc2fe12105fcc4c57c73fe2
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
372
372
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/dms/tree/17.0/dms"><img alt="OCA/dms" src="https://img.shields.io/badge/github-OCA%2Fdms-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/dms-17-0/dms-17-0-dms"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
373
373
|
<p>DMS is a module for creating, managing and viewing document files
|
@@ -35,6 +35,19 @@ class StorageAttachmentTestCase(StorageAttachmentBaseCase):
|
|
35
35
|
self.assertFalse(file_01.exists(), "File should not exist")
|
36
36
|
self.assertFalse(directory.exists(), "Directory should not exist")
|
37
37
|
|
38
|
+
@users("dms-manager")
|
39
|
+
def test_storage_attachment_record_db_unlink(self):
|
40
|
+
self._create_attachment("demo.txt")
|
41
|
+
self.assertTrue(
|
42
|
+
self.storage.storage_file_ids.filtered(lambda x: x.name == "demo.txt")
|
43
|
+
)
|
44
|
+
directory = self._get_partner_directory()
|
45
|
+
self.assertEqual(directory.res_model, self.partner._name)
|
46
|
+
self.assertEqual(directory.res_id, self.partner.id)
|
47
|
+
directory.res_id = -1 # Trick to reference a non-existing record
|
48
|
+
directories = self.env["dms.directory"].search([])
|
49
|
+
self.assertNotIn(directory.id, directories.ids)
|
50
|
+
|
38
51
|
@users("dms-manager")
|
39
52
|
def test_storage_attachment_misc(self):
|
40
53
|
attachment = self._create_attachment("demo.txt")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: odoo-addon-dms
|
3
|
-
Version: 17.0.1.
|
3
|
+
Version: 17.0.1.1.0
|
4
4
|
Requires-Python: >=3.10
|
5
5
|
Requires-Dist: odoo>=17.0a,<17.1dev
|
6
6
|
Summary: Document Management System for Odoo
|
@@ -22,7 +22,7 @@ Document Management System
|
|
22
22
|
!! This file is generated by oca-gen-addon-readme !!
|
23
23
|
!! changes will be overwritten. !!
|
24
24
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
25
|
-
!! source digest: sha256:
|
25
|
+
!! source digest: sha256:6a314d55775609f48d0cd0a6da9c801d0eb48b481cc2fe12105fcc4c57c73fe2
|
26
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
27
27
|
|
28
28
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
@@ -1,6 +1,6 @@
|
|
1
|
-
odoo/addons/dms/README.rst,sha256=
|
1
|
+
odoo/addons/dms/README.rst,sha256=L7S8OGPAa5mVrfKwI7M-nXJJClbfHb6iCfkM3yQD0jU,8174
|
2
2
|
odoo/addons/dms/__init__.py,sha256=dnUeA_K1torbiMNF3tt2dtECdk-FkWm01DByr9MBMIA,69
|
3
|
-
odoo/addons/dms/__manifest__.py,sha256=
|
3
|
+
odoo/addons/dms/__manifest__.py,sha256=IyFxVCuAyCH2O9ZW0WwMZNtMAyHuGYSimq5jIN9dQBI,2440
|
4
4
|
odoo/addons/dms/actions/file.xml,sha256=z4UWfhmDcaOxdcwMbFH9Wjgi8_23RRAouD_o3FFaiaw,520
|
5
5
|
odoo/addons/dms/controllers/__init__.py,sha256=akfNDwFGryweTYowOA3DbbP0zvLmQtCdihtGhYvsIPQ,40
|
6
6
|
odoo/addons/dms/controllers/main.py,sha256=DW7wSHB_47kkxQQMCuic8ptvs_wnF-i6vJ0sXIKGgUk,531
|
@@ -29,9 +29,9 @@ odoo/addons/dms/models/access_groups.py,sha256=JPV-iZQ_FgJPEwxBUBwbz4h1t7C0TZ_Mv
|
|
29
29
|
odoo/addons/dms/models/base.py,sha256=neudsxtQLBpS4uq6haivMC2Lwtfprajx1CsLJSGDaWA,1336
|
30
30
|
odoo/addons/dms/models/directory.py,sha256=5MTkF-jOEprcUVS3H3zndVvBhJio3B9PRcM8IoxLfmc,27682
|
31
31
|
odoo/addons/dms/models/dms_category.py,sha256=DH1R7QUQQbGpGwDGxfm0oHenDVvWOrSeKmr-sttfvus,3337
|
32
|
-
odoo/addons/dms/models/dms_file.py,sha256=
|
33
|
-
odoo/addons/dms/models/dms_security_mixin.py,sha256=
|
34
|
-
odoo/addons/dms/models/ir_attachment.py,sha256=
|
32
|
+
odoo/addons/dms/models/dms_file.py,sha256=jNMaUtJtYLph90fFz-2Yf_w8qXzvntx0Ai4P5kLv2fc,24115
|
33
|
+
odoo/addons/dms/models/dms_security_mixin.py,sha256=ZF_PUR3nHh0_rVw1-7D4pbcpi7bzUTETJPaIL-wWklw,9832
|
34
|
+
odoo/addons/dms/models/ir_attachment.py,sha256=ABXO54R3D3RECp4Kza8VqfrpDWBbmOSdsTPUs_ctpyA,3987
|
35
35
|
odoo/addons/dms/models/ir_binary.py,sha256=K62N0v6hEM5AE5GxB2iiPL86ISZy8lNvtTdQABrN_-0,710
|
36
36
|
odoo/addons/dms/models/mail_thread.py,sha256=DBanYxThmxvMLoTWDvh2dBn9mHdADJx0gWTfifa4bcM,561
|
37
37
|
odoo/addons/dms/models/mixins_thumbnail.py,sha256=7u27IgH4cXxSZXkZF-QWgS9uQ96u1I3Bp25xvYzpUXs,1659
|
@@ -39,7 +39,7 @@ odoo/addons/dms/models/onboarding_onboarding.py,sha256=mYvBessDtceIF0MAIq1VozOlO
|
|
39
39
|
odoo/addons/dms/models/onboarding_onboarding_step.py,sha256=TCfCS7OTI4UrKLjyAQHNohnXZckQO0x9_CaLhrifcn4,1717
|
40
40
|
odoo/addons/dms/models/res_company.py,sha256=shWgGMoYCgMZSCt0Um86bIOiCfLYZoQNMDEv1rj9xEQ,2548
|
41
41
|
odoo/addons/dms/models/res_config_settings.py,sha256=WyjxGAZsLQz9ot3zeVRrSGGJv3CDXmiL_eNEC920RdA,664
|
42
|
-
odoo/addons/dms/models/storage.py,sha256=
|
42
|
+
odoo/addons/dms/models/storage.py,sha256=TllBE_5bly7uuCmNaDi6aDZlCR3FFrXbONNorA3JmRg,4652
|
43
43
|
odoo/addons/dms/models/tag.py,sha256=WafaPNpX_orq87_10BZ47TUN5xAePL-GJbwLgpP7Ke0,1727
|
44
44
|
odoo/addons/dms/readme/CONFIGURE.md,sha256=QjS-XIg5Wil_bo_NLJxd5-7Rj0VG1jXw6HtZm59e77w,2220
|
45
45
|
odoo/addons/dms/readme/CONTRIBUTORS.md,sha256=x0G7Mqdashp8zBCb7JJ_19PRFW2vurVeU1I8KkZFLxY,510
|
@@ -52,7 +52,7 @@ odoo/addons/dms/security/ir.model.access.csv,sha256=_SuEwHD3SOXbpLalbr5FqGjPvwtD
|
|
52
52
|
odoo/addons/dms/security/security.xml,sha256=PNM3fDyFN4CWooj_aMkLqTR0CYrjAugsCAKbcTm6crw,9159
|
53
53
|
odoo/addons/dms/static/description/icon.png,sha256=KfrJt0JWFclsfbF1KsyjikkjwX3ib9OLlBf2QwyXSD4,1233
|
54
54
|
odoo/addons/dms/static/description/icon.svg,sha256=kOfm8NcYxdEWmr5jGDjvCXmDix2mw-5LT0ZQ4omZ2c0,1820
|
55
|
-
odoo/addons/dms/static/description/index.html,sha256=
|
55
|
+
odoo/addons/dms/static/description/index.html,sha256=qzrySZ1e0Ide4IMIbRpYiGCgHZEcxgbkEKjUL282yCo,21522
|
56
56
|
odoo/addons/dms/static/description/portal_icon.svg,sha256=z5RFc6mU_DAgNHfOS2OncYBlQBczsawqwRI1IFwct0M,4801
|
57
57
|
odoo/addons/dms/static/icons/file_ai.svg,sha256=HeCXVJivVnn6jjj__5WJiLfZv4mrmAamPFek0CwozCc,3343
|
58
58
|
odoo/addons/dms/static/icons/file_aj.svg,sha256=mUbfvaV5_m3zJ3zZKldBbaFz4AZNQNecSZ1W_JCZeE4,3063
|
@@ -184,7 +184,7 @@ odoo/addons/dms/tests/test_directory.py,sha256=IGCy4xcWmVz5KWkPzmjUTxr64_GAiZEYE
|
|
184
184
|
odoo/addons/dms/tests/test_file.py,sha256=YTgPQfUfy2KJRxak2SO-Ey8_5avbjGuPGyFAGsEsJMw,7710
|
185
185
|
odoo/addons/dms/tests/test_file_database.py,sha256=FhRakGMc4lWlOS3tqIb-o-kH4CuE_6jW6V_GYc2pKJE,5843
|
186
186
|
odoo/addons/dms/tests/test_portal.py,sha256=_dPa5ql6iWV_SjJjuxwXHPQt3ermzoSiiyKfvGAhCAI,3949
|
187
|
-
odoo/addons/dms/tests/test_storage_attachment.py,sha256=
|
187
|
+
odoo/addons/dms/tests/test_storage_attachment.py,sha256=z1sT7UZ57tabCGprKPrbiOgkmr7-kwKqMMRFjX0-nyU,6650
|
188
188
|
odoo/addons/dms/tests/test_storage_database.py,sha256=S9eDN2BrnzUAmeEPlh7RQ6nhnMEPumxiducEr1khcQw,5670
|
189
189
|
odoo/addons/dms/tests/data/dms.category.csv,sha256=VBWa6-PEA6__yv_D6CXUZ7xU-8AAxD7z8jWo4sKb8S0,2631
|
190
190
|
odoo/addons/dms/tests/data/dms.directory.csv,sha256=Klh3tEdMt_BB9hWgc_FRUsv_q4Uy-asUut0EuTmnLLU,53514
|
@@ -208,7 +208,7 @@ odoo/addons/dms/wizards/wizard_dms_file_move.py,sha256=zQouQDJuLWOrjzkksiUaTf0DF
|
|
208
208
|
odoo/addons/dms/wizards/wizard_dms_file_move_views.xml,sha256=bYWdX_QlMpIOS5gRk7iEyddHKLCvAkvzDxfT3oM1lCo,1931
|
209
209
|
odoo/addons/dms/wizards/wizard_dms_share.py,sha256=s7n6nQy0I6qVsvQ7Z57lfY28wi8tbd9062Bdw-BSoWg,558
|
210
210
|
odoo/addons/dms/wizards/wizard_dms_share_views.xml,sha256=63BhWyowqJ2Yf3RdOdjT6WvC13jXxTKzsJEZXmaHv-A,1230
|
211
|
-
odoo_addon_dms-17.0.1.
|
212
|
-
odoo_addon_dms-17.0.1.
|
213
|
-
odoo_addon_dms-17.0.1.
|
214
|
-
odoo_addon_dms-17.0.1.
|
211
|
+
odoo_addon_dms-17.0.1.1.0.dist-info/METADATA,sha256=6UKJwXzZpqwq5N4sAXdqLxPavkHWiCWprd6lzhYehQM,8694
|
212
|
+
odoo_addon_dms-17.0.1.1.0.dist-info/WHEEL,sha256=8Rd4enx1PCuyDWP4SABqO5Fv8rpaknqp3VzjoFFLa6c,83
|
213
|
+
odoo_addon_dms-17.0.1.1.0.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
214
|
+
odoo_addon_dms-17.0.1.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|