odoo-addon-dms 15.0.1.14.0.2__py3-none-any.whl → 15.0.1.14.1__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_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 +8 -5
- odoo/addons/dms/tests/test_storage_attachment.py +13 -0
- {odoo_addon_dms-15.0.1.14.0.2.dist-info → odoo_addon_dms-15.0.1.14.1.dist-info}/METADATA +2 -2
- {odoo_addon_dms-15.0.1.14.0.2.dist-info → odoo_addon_dms-15.0.1.14.1.dist-info}/RECORD +11 -11
- {odoo_addon_dms-15.0.1.14.0.2.dist-info → odoo_addon_dms-15.0.1.14.1.dist-info}/WHEEL +0 -0
- {odoo_addon_dms-15.0.1.14.0.2.dist-info → odoo_addon_dms-15.0.1.14.1.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:c3e4783bb900f747cfeef2b98eb51dced255041a9591bbe0ac8b82d8a695331a
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
odoo/addons/dms/__manifest__.py
CHANGED
|
@@ -132,8 +132,11 @@ class DmsSecurityMixin(models.AbstractModel):
|
|
|
132
132
|
continue
|
|
133
133
|
domains.append([("res_model", "=", model._name), ("res_id", "=", False)])
|
|
134
134
|
# Check record access in batch too
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
res_ids = [i for i in group["res_id"] if i] # Hack to remove None res_id
|
|
136
|
+
# Apply exists to skip records that do not exist. (e.g. a res.partner deleted
|
|
137
|
+
# by database).
|
|
138
|
+
model_records = model.browse(res_ids).exists()
|
|
139
|
+
related_ok = model_records._filter_access_rules_python(operation)
|
|
137
140
|
if not related_ok:
|
|
138
141
|
continue
|
|
139
142
|
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):
|
|
@@ -35,9 +36,26 @@ class IrAttachment(models.Model):
|
|
|
35
36
|
}
|
|
36
37
|
)
|
|
37
38
|
|
|
39
|
+
@ormcache("model")
|
|
40
|
+
def _dms_operations_from_model(self, model):
|
|
41
|
+
# Apply sudo to prevent ir.rule from being applied.
|
|
42
|
+
item = self.env["dms.storage"].sudo().search([("model_ids.model", "=", model)])
|
|
43
|
+
return bool(item)
|
|
44
|
+
|
|
38
45
|
def _dms_operations(self):
|
|
46
|
+
"""Perform the operation only if there is a storage with linked models.
|
|
47
|
+
The directory (dms.directory) linked to the record (if it does not exist)
|
|
48
|
+
and the file (dms.file) with the linked attachment would be created.
|
|
49
|
+
"""
|
|
39
50
|
for attachment in self:
|
|
40
|
-
if
|
|
51
|
+
if (
|
|
52
|
+
not attachment.res_model
|
|
53
|
+
or not attachment.res_id
|
|
54
|
+
or (
|
|
55
|
+
attachment.res_model
|
|
56
|
+
and not self._dms_operations_from_model(attachment.res_model)
|
|
57
|
+
)
|
|
58
|
+
):
|
|
41
59
|
continue
|
|
42
60
|
directories = attachment._get_dms_directories(
|
|
43
61
|
attachment.res_model, attachment.res_id
|
|
@@ -145,3 +145,9 @@ class Storage(models.Model):
|
|
|
145
145
|
def _compute_count_storage_files(self):
|
|
146
146
|
for record in self:
|
|
147
147
|
record.count_storage_files = len(record.storage_file_ids)
|
|
148
|
+
|
|
149
|
+
def write(self, values):
|
|
150
|
+
res = super().write(values)
|
|
151
|
+
if "model_ids" in values:
|
|
152
|
+
self.env["ir.attachment"].clear_caches()
|
|
153
|
+
return res
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
:Author: David Goodger (goodger@python.org)
|
|
11
|
-
:Id: $Id: html4css1.css
|
|
11
|
+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
|
12
12
|
:Copyright: This stylesheet has been placed in the public domain.
|
|
13
13
|
|
|
14
14
|
Default cascading style sheet for the HTML output of Docutils.
|
|
15
|
+
Despite the name, some widely supported CSS2 features are used.
|
|
15
16
|
|
|
16
17
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
17
18
|
customize this style sheet.
|
|
@@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
|
274
275
|
margin-left: 2em ;
|
|
275
276
|
margin-right: 2em }
|
|
276
277
|
|
|
277
|
-
pre.code .ln { color:
|
|
278
|
+
pre.code .ln { color: gray; } /* line numbers */
|
|
278
279
|
pre.code, code { background-color: #eeeeee }
|
|
279
280
|
pre.code .comment, code .comment { color: #5C6576 }
|
|
280
281
|
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
@@ -300,7 +301,7 @@ span.option {
|
|
|
300
301
|
span.pre {
|
|
301
302
|
white-space: pre }
|
|
302
303
|
|
|
303
|
-
span.problematic {
|
|
304
|
+
span.problematic, pre.problematic {
|
|
304
305
|
color: red }
|
|
305
306
|
|
|
306
307
|
span.section-subtitle {
|
|
@@ -366,7 +367,7 @@ ul.auto-toc {
|
|
|
366
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
367
368
|
!! changes will be overwritten. !!
|
|
368
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
369
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:c3e4783bb900f747cfeef2b98eb51dced255041a9591bbe0ac8b82d8a695331a
|
|
370
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
371
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/15.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-15-0/dms-15-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=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
372
373
|
<p>DMS is a module for creating, managing and viewing document files directly
|
|
@@ -542,7 +543,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|
|
542
543
|
<div class="section" id="maintainers">
|
|
543
544
|
<h2><a class="toc-backref" href="#toc-entry-14">Maintainers</a></h2>
|
|
544
545
|
<p>This module is maintained by the OCA.</p>
|
|
545
|
-
<a class="reference external image-reference" href="https://odoo-community.org"
|
|
546
|
+
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
547
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
548
|
+
</a>
|
|
546
549
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
547
550
|
mission is to support the collaborative development of Odoo features and
|
|
548
551
|
promote its widespread use.</p>
|
|
@@ -29,6 +29,19 @@ class StorageAttachmentTestCase(StorageAttachmentBaseCase):
|
|
|
29
29
|
self.assertFalse(file_01.exists())
|
|
30
30
|
self.assertFalse(directory.exists())
|
|
31
31
|
|
|
32
|
+
@users("dms-manager")
|
|
33
|
+
def test_storage_attachment_record_db_unlink(self):
|
|
34
|
+
self._create_attachment("demo.txt")
|
|
35
|
+
self.assertTrue(
|
|
36
|
+
self.storage.storage_file_ids.filtered(lambda x: x.name == "demo.txt")
|
|
37
|
+
)
|
|
38
|
+
directory = self._get_partner_directory()
|
|
39
|
+
self.assertEqual(directory.res_model, self.partner._name)
|
|
40
|
+
self.assertEqual(directory.res_id, self.partner.id)
|
|
41
|
+
directory.res_id = 0 # Trick to reference a non-existing record
|
|
42
|
+
directories = self.env["dms.directory"].search([])
|
|
43
|
+
self.assertNotIn(directory.id, directories.ids)
|
|
44
|
+
|
|
32
45
|
@users("dms-manager")
|
|
33
46
|
def test_storage_attachment_misc(self):
|
|
34
47
|
attachment = self._create_attachment("demo.txt")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-dms
|
|
3
|
-
Version: 15.0.1.14.
|
|
3
|
+
Version: 15.0.1.14.1
|
|
4
4
|
Summary: Document Management System for Odoo
|
|
5
5
|
Home-page: https://github.com/OCA/dms
|
|
6
6
|
Author: MuK IT, Tecnativa, Odoo Community Association (OCA)
|
|
@@ -24,7 +24,7 @@ Document Management System
|
|
|
24
24
|
!! This file is generated by oca-gen-addon-readme !!
|
|
25
25
|
!! changes will be overwritten. !!
|
|
26
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
-
!! source digest: sha256:
|
|
27
|
+
!! source digest: sha256:c3e4783bb900f747cfeef2b98eb51dced255041a9591bbe0ac8b82d8a695331a
|
|
28
28
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
29
29
|
|
|
30
30
|
.. |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=9gSe_R-Ta677ekmXU-dKE431qkN8kKW8nCNgh94AUd8,7464
|
|
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=scsiFw4kEosS68cE2ReMfh3LtRSequ8ootaQKtVjERQ,2227
|
|
4
4
|
odoo/addons/dms/actions/file.xml,sha256=NlRIQoCbbDSaRmsumJP9dcrNtYpQji74hwhfi5TillE,524
|
|
5
5
|
odoo/addons/dms/controllers/__init__.py,sha256=akfNDwFGryweTYowOA3DbbP0zvLmQtCdihtGhYvsIPQ,40
|
|
6
6
|
odoo/addons/dms/controllers/main.py,sha256=3HvKTk8OiFPiqkKN952Ozy-9NmtpLnaYsguL-VSmicY,1902
|
|
@@ -27,13 +27,13 @@ odoo/addons/dms/models/base.py,sha256=t7uhbkDE9L4UdvYJAwPTlX5ff2Y9S01urlFfC3KlLx
|
|
|
27
27
|
odoo/addons/dms/models/category.py,sha256=goe3tZbwDXtlxrwGB0_sGMJW7RkJh3MtTBe4YvYokbI,4110
|
|
28
28
|
odoo/addons/dms/models/directory.py,sha256=j4LnDdD7GkavjYYnLWyvX57wLwVKibMkS1YAlFmwHlQ,28761
|
|
29
29
|
odoo/addons/dms/models/dms_file.py,sha256=vyIS-2P-iV7iHBkHeacNN9y6ap1289soT_0dwmKrSSk,24622
|
|
30
|
-
odoo/addons/dms/models/dms_security_mixin.py,sha256=
|
|
31
|
-
odoo/addons/dms/models/ir_attachment.py,sha256
|
|
30
|
+
odoo/addons/dms/models/dms_security_mixin.py,sha256=P9bembzv4PNYsmJvkutMrYagIA_vDU8Hg3bV2gSWfc8,9868
|
|
31
|
+
odoo/addons/dms/models/ir_attachment.py,sha256=aEhmB_nH0aLyOqv4ECKX4yRBUn2txbdMgH0cUa8eCPw,3988
|
|
32
32
|
odoo/addons/dms/models/mail_thread.py,sha256=ccAn2MHONCncjsJewBrLqMVBl6tmn2kezyJVJq2utVk,583
|
|
33
33
|
odoo/addons/dms/models/mixins_thumbnail.py,sha256=DCb8wrWTjdQp2ev9SfYHe9LLZuC18c5jSftm2Er9Aho,1466
|
|
34
34
|
odoo/addons/dms/models/res_company.py,sha256=fZfwANu5zUBeBR7cdUB7FwpNrKxB56gW-rL3ZXrAP7s,3368
|
|
35
35
|
odoo/addons/dms/models/res_config_settings.py,sha256=3kAoWaq8j1HRdtuJI-uLStVdVh-qAwza72oLvy9N4Ds,665
|
|
36
|
-
odoo/addons/dms/models/storage.py,sha256=
|
|
36
|
+
odoo/addons/dms/models/storage.py,sha256=VGvDINTR2BXz6kJGVbXDkYsXaimYBFVc0rgP7c0IamI,5076
|
|
37
37
|
odoo/addons/dms/models/tag.py,sha256=Gjz4dTU2NRBdKg1hqeQcVWl85KSf8FEktxp97bJkCII,1729
|
|
38
38
|
odoo/addons/dms/readme/CONFIGURE.rst,sha256=oECnKyii9btOFtG2E4yyw7gqY36_tKhdg5V-w10SII0,1910
|
|
39
39
|
odoo/addons/dms/readme/CONTRIBUTORS.rst,sha256=jbGCo2Q53HnMAGN0nHuBDT44BPkpzmILDOtdny-uoyg,246
|
|
@@ -46,7 +46,7 @@ odoo/addons/dms/security/ir.model.access.csv,sha256=_SuEwHD3SOXbpLalbr5FqGjPvwtD
|
|
|
46
46
|
odoo/addons/dms/security/security.xml,sha256=plasjSwS2w5GK07BvW9obXNOpPgeBLKeEkUJ6Wpc6nA,9085
|
|
47
47
|
odoo/addons/dms/static/description/icon.png,sha256=8xwcyAfhzMOu_xBinu4KwZsvmqUj6X5aF2LUQvvwdc4,7197
|
|
48
48
|
odoo/addons/dms/static/description/icon.svg,sha256=cICSzGzl0Z00q7m0yhriujt2ip5_v4ymxAMTGzolxsc,8025
|
|
49
|
-
odoo/addons/dms/static/description/index.html,sha256=
|
|
49
|
+
odoo/addons/dms/static/description/index.html,sha256=WZ6Vm7jDhGvn9kKephdOE8j0wcRdxxEPerJpOzWCHAA,19785
|
|
50
50
|
odoo/addons/dms/static/icons/file_ai.svg,sha256=HeCXVJivVnn6jjj__5WJiLfZv4mrmAamPFek0CwozCc,3343
|
|
51
51
|
odoo/addons/dms/static/icons/file_aj.svg,sha256=mUbfvaV5_m3zJ3zZKldBbaFz4AZNQNecSZ1W_JCZeE4,3063
|
|
52
52
|
odoo/addons/dms/static/icons/file_avi.svg,sha256=Pf78IrO6gGsg3aUVguOu6osDwLYz5ceIOLMbTRpya5s,1862
|
|
@@ -168,7 +168,7 @@ odoo/addons/dms/tests/test_directory.py,sha256=Dx8nNMm4RlVTod8ne7BmcRdsFjk9pBcto
|
|
|
168
168
|
odoo/addons/dms/tests/test_file.py,sha256=V-IBVb_MhleCUkmLA7e4tjEdLwcN7S2CrCx8B_kOMMw,4663
|
|
169
169
|
odoo/addons/dms/tests/test_file_database.py,sha256=xmBb360UdCMTkMGBfynapcJeWbh4SP3u8tszCA0UF3U,4689
|
|
170
170
|
odoo/addons/dms/tests/test_portal.py,sha256=e0lOaB6UH3qWzLWEREVSwjEiy_iRZJ0JGVRrse-VTEY,3300
|
|
171
|
-
odoo/addons/dms/tests/test_storage_attachment.py,sha256=
|
|
171
|
+
odoo/addons/dms/tests/test_storage_attachment.py,sha256=qSgEeopfdjVPknMLzsxoxD8Cf16VkxbQSPJQqv_bU2w,5834
|
|
172
172
|
odoo/addons/dms/tests/test_storage_database.py,sha256=zJfS2XpdJj6CK2LixkgRGCzdzAMU5pUhjx2t9-kEAq4,3869
|
|
173
173
|
odoo/addons/dms/tests/data/dms.category.csv,sha256=VBWa6-PEA6__yv_D6CXUZ7xU-8AAxD7z8jWo4sKb8S0,2631
|
|
174
174
|
odoo/addons/dms/tests/data/dms.directory.csv,sha256=Klh3tEdMt_BB9hWgc_FRUsv_q4Uy-asUut0EuTmnLLU,53514
|
|
@@ -193,7 +193,7 @@ odoo/addons/dms/wizards/wizard_dms_file_move.py,sha256=zQouQDJuLWOrjzkksiUaTf0DF
|
|
|
193
193
|
odoo/addons/dms/wizards/wizard_dms_file_move_views.xml,sha256=bYWdX_QlMpIOS5gRk7iEyddHKLCvAkvzDxfT3oM1lCo,1931
|
|
194
194
|
odoo/addons/dms/wizards/wizard_dms_share.py,sha256=MyfiGhkeQz4g93ymzj07mHBdXrtX3K4PQzwzWV_iIqo,544
|
|
195
195
|
odoo/addons/dms/wizards/wizard_dms_share_views.xml,sha256=63BhWyowqJ2Yf3RdOdjT6WvC13jXxTKzsJEZXmaHv-A,1230
|
|
196
|
-
odoo_addon_dms-15.0.1.14.
|
|
197
|
-
odoo_addon_dms-15.0.1.14.
|
|
198
|
-
odoo_addon_dms-15.0.1.14.
|
|
199
|
-
odoo_addon_dms-15.0.1.14.
|
|
196
|
+
odoo_addon_dms-15.0.1.14.1.dist-info/METADATA,sha256=YhJX8PUJUoeGVOxRsqR9t8II9yp9HjnQXDmROPlGLsE,8109
|
|
197
|
+
odoo_addon_dms-15.0.1.14.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
198
|
+
odoo_addon_dms-15.0.1.14.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
199
|
+
odoo_addon_dms-15.0.1.14.1.dist-info/RECORD,,
|
|
File without changes
|
{odoo_addon_dms-15.0.1.14.0.2.dist-info → odoo_addon_dms-15.0.1.14.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|