Skip to content

Commit 71a3e94

Browse files
committed
Merge PR #399 into 18.0
Signed-off-by pedrobaeza
2 parents ffc524b + 1f08ada commit 71a3e94

File tree

209 files changed

+38601
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+38601
-0
lines changed

dms/README.rst

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
==========================
2+
Document Management System
3+
==========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:966c4331ff7c75b1ea8cb1d065c878d81250957cd305a5d6422def133e2a7d63
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdms-lightgray.png?logo=github
20+
:target: https://github.com/OCA/dms/tree/18.0/dms
21+
:alt: OCA/dms
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
DMS is a module for creating, managing and viewing document files
32+
directly within Odoo. This module is only the basis for an entire
33+
ecosystem of apps that extend and seamlessly integrate with the document
34+
management system.
35+
36+
This module adds portal functionality for directories and files for
37+
allowed users, both portal or internal users. You can get as well a
38+
tokenized link from a directory or a file for sharing it with any
39+
anonymous user.
40+
41+
**Table of contents**
42+
43+
.. contents::
44+
:local:
45+
46+
Installation
47+
============
48+
49+
Preview
50+
-------
51+
52+
``python-magic`` library is recommended to be installed for having whole
53+
support to get proper file types and file preview.
54+
55+
Configuration
56+
=============
57+
58+
Configuration
59+
=============
60+
61+
To configure this module, you need to:
62+
63+
1. Create a storage
64+
-------------------
65+
66+
1. Go to *Documents -> Configuration -> Storages*.
67+
68+
2. Create a new document storage. You can choose between three options
69+
on ``Save Type``:
70+
71+
- ``Database``: Store the files on the database as a field
72+
- ``Attachment``: Store the files as attachments
73+
- ``File``: Store the files on the file system
74+
75+
2. Create an access group
76+
-------------------------
77+
78+
1. Next, create an administrative access group. Go to *Configuration ->
79+
Access Groups*.
80+
81+
- Create a new group, name it appropriately, and turn on all three
82+
permissions (Create, Write and Unlink. Read is implied and always
83+
enabled).
84+
- Add any other top-level administrative users to the group if
85+
needed (your user should already be there).
86+
- You can create other groups in here later for fine-grained access
87+
control.
88+
89+
3. Create a directory
90+
---------------------
91+
92+
1. Afterward, go to *Documents -> Directories*.
93+
94+
2. Create a new directory, mark it as root and select the previously
95+
created setting.
96+
97+
- Select the *Groups* tab and add your administrative group created
98+
above. If your directory was already created before the group, you
99+
can also add it in the access groups (*Configuration -> Access
100+
Groups*).
101+
102+
3. In the directory settings, you can also add other access groups
103+
(created above) that will be able to:
104+
105+
- read
106+
- create
107+
- write
108+
- delete
109+
110+
Migration
111+
=========
112+
113+
If you need to modify the storage ``Save Type`` you might want to
114+
migrate the file data. To achieve it, you need to:
115+
116+
1. Go to *Documents -> Configuration -> Storage* and select the storage
117+
you want to modify
118+
2. Modify the save type
119+
3. Press the button Migrate files if you want to migrate all the files
120+
at once
121+
4. Press the button Manual File Migration to specify files one by one
122+
123+
You can check all the files that still need to be migrated from all
124+
storages and migrate them manually on *Documents -> Configuration ->
125+
Migration*
126+
127+
File Wizard Selection
128+
=====================
129+
130+
There is an action called ``action_dms_file_wizard_selector`` to open a
131+
wizard to list files in kanban view. This can be used (example
132+
dms_attachment_link module) to add a button in kanban view with the
133+
action we need.
134+
135+
Usage
136+
=====
137+
138+
The best way to manage the documents is to switch to the Documents view.
139+
Existing documents can be managed there and new documents can be
140+
created.
141+
142+
Portal functionality
143+
--------------------
144+
145+
You can add any portal user to DMS access groups, and then allow that
146+
group in directories, so they will see in the portal such directories
147+
and their files. Another possibility is to click on "Share" button
148+
inside a directory or a file for obtaining a tokenized link for single
149+
access to that resource, no matter if logged or not.
150+
151+
Known issues / Roadmap
152+
======================
153+
154+
- Files preview in portal
155+
- Allow to download folder in portal and create zip file with all
156+
content
157+
- Save in cache own_root directories and update in every
158+
create/write/unlink function
159+
- Add a migration procedure for converting an storage to attachment one
160+
for populating existing records with attachments as folders
161+
- Add a link from attachment view in chatter to linked documents
162+
- If Inherit permissions from related record (the
163+
inherit_access_from_parent_record field from storage) is changed when
164+
directories already exist, inconsistencies may occur because groups
165+
defined in the directories and subdirectories will still exist, all
166+
groups in these directories should be removed before changing.
167+
- Since portal users can read ``dms.storage`` records, if your module
168+
extends this model to another storage backend that needs using
169+
secrets, remember to forbid access to the secrets fields by other
170+
means. It would be nice to be able to remove that rule at some point.
171+
- Searchpanel in files: Highlight items (shading) without records when
172+
filtering something (by name for example).
173+
- Accessing the clipboard (for example copy share link of
174+
file/directory) is limited to secure connections. It also happens in
175+
any part of Odoo.
176+
177+
Bug Tracker
178+
===========
179+
180+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/dms/issues>`_.
181+
In case of trouble, please check there if your issue has already been reported.
182+
If you spotted it first, help us to smash it by providing a detailed and welcomed
183+
`feedback <https://github.com/OCA/dms/issues/new?body=module:%20dms%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
184+
185+
Do not contact contributors directly about support or help with technical issues.
186+
187+
Credits
188+
=======
189+
190+
Authors
191+
-------
192+
193+
* MuK IT
194+
* Tecnativa
195+
196+
Contributors
197+
------------
198+
199+
- Mathias Markl <mathias.markl@mukit.at>
200+
- Enric Tobella <etobella@creublanca.es>
201+
- Antoni Romera
202+
- Gelu Boros <gelu.boros@rgbconsulting.com>
203+
- `Tecnativa <https://www.tecnativa.com>`__:
204+
205+
- Víctor Martínez
206+
- Pedro M. Baeza
207+
- Jairo Llopis
208+
209+
- `Elego <https://www.elegosoft.com>`__:
210+
211+
- Yu Weng <yweng@elegosoft.com>
212+
- Philip Witte <phillip.witte@elegosoft.com>
213+
- Khanh Bui <khanh.bui@mail.elegosoft.com>
214+
215+
- `Subteno <https://www.subteno.com>`__:
216+
217+
- Timothée Vannier <tva@subteno.com>
218+
219+
- `Kencove <https://www.kencove.com>`__:
220+
221+
- Mohamed Alkobrosli <malkobrosly@kencove.com>
222+
223+
Other credits
224+
-------------
225+
226+
Some pictures are based on or inspired by:
227+
228+
- `Roundicons <https://www.flaticon.com/authors/roundicons>`__
229+
- `Smashicons <https://www.flaticon.com/authors/smashicons>`__
230+
- `EmojiOne <https://github.com/EmojiTwo/emojitwo>`__ : Portal DMS icon
231+
- `GitHub Octicons <https://github.com/primer/octicons/>`__ : The main
232+
DMS icon
233+
234+
Maintainers
235+
-----------
236+
237+
This module is maintained by the OCA.
238+
239+
.. image:: https://odoo-community.org/logo.png
240+
:alt: Odoo Community Association
241+
:target: https://odoo-community.org
242+
243+
OCA, or the Odoo Community Association, is a nonprofit organization whose
244+
mission is to support the collaborative development of Odoo features and
245+
promote its widespread use.
246+
247+
This module is part of the `OCA/dms <https://github.com/OCA/dms/tree/18.0/dms>`_ project on GitHub.
248+
249+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

dms/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from . import controllers
2+
from . import models
3+
from . import wizards

dms/__manifest__.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright 2017-2019 MuK IT GmbH
2+
# Copyright 2024 Subteno - Timothée Vannier (https://www.subteno.com).
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
4+
5+
{
6+
"name": "Document Management System",
7+
"summary": """Document Management System for Odoo""",
8+
"version": "18.0.1.0.0",
9+
"category": "Document Management",
10+
"license": "LGPL-3",
11+
"website": "https://github.com/OCA/dms",
12+
"author": "MuK IT, Tecnativa, Odoo Community Association (OCA)",
13+
"depends": [
14+
"mail",
15+
"http_routing",
16+
"onboarding",
17+
"portal",
18+
"base",
19+
"web",
20+
],
21+
"data": [
22+
# Security
23+
"security/security.xml",
24+
"security/ir.model.access.csv",
25+
# Actions
26+
"actions/file.xml",
27+
# Templates
28+
"template/portal.xml",
29+
# Data
30+
"data/onboarding_data.xml",
31+
# Views
32+
"views/dms_tag.xml",
33+
"views/dms_category.xml",
34+
"views/dms_file.xml",
35+
"views/dms_directory.xml",
36+
"views/storage.xml",
37+
"views/dms_access_groups_views.xml",
38+
"views/res_config_settings.xml",
39+
"views/menu.xml",
40+
# Wizard
41+
"wizards/wizard_dms_file_move_views.xml",
42+
"wizards/wizard_dms_share_views.xml",
43+
],
44+
"assets": {
45+
"web.assets_backend": [
46+
# JS
47+
"dms/static/src/models/*.js",
48+
"dms/static/src/js/fields/path_json/path_owl.esm.js",
49+
"dms/static/src/js/fields/preview_binary/preview_record.esm.js",
50+
"dms/static/src/js/views/*.esm.js",
51+
# XML
52+
"dms/static/src/js/fields/path_json/path_owl.xml",
53+
"dms/static/src/js/fields/preview_binary/preview_record.xml",
54+
"dms/static/src/js/views/*.xml",
55+
],
56+
"web.assets_frontend": [
57+
"dms/static/src/scss/portal.scss",
58+
],
59+
"web.assets_tests": [
60+
"dms/static/tests/tours/**/*",
61+
],
62+
},
63+
"demo": [
64+
"demo/res_users.xml",
65+
"demo/access_group.xml",
66+
"demo/category.xml",
67+
"demo/tag.xml",
68+
"demo/storage.xml",
69+
"demo/directory.xml",
70+
"demo/file.xml",
71+
],
72+
"icon": "/dms/static/description/icon.png",
73+
"application": True,
74+
}

dms/actions/file.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
Copyright 2017-2019 MuK IT GmbH
4+
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
5+
-->
6+
<odoo>
7+
<record id="action_dms_attachment_migrate" model="ir.actions.server">
8+
<field name="name">Migrate</field>
9+
<field name="model_id" ref="model_dms_file" />
10+
<field name="binding_model_id" ref="dms.model_dms_file" />
11+
<field name="state">code</field>
12+
<field name="code">records.action_migrate()</field>
13+
</record>
14+
</odoo>

dms/controllers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import main
2+
from . import portal

dms/controllers/main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2017-2019 MuK IT GmbH
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
from odoo import http
4+
from odoo.http import request
5+
6+
7+
class OnboardingController(http.Controller):
8+
@http.route("/config/dms.forbidden_extensions", type="json", auth="user")
9+
def forbidden_extensions(self, **_kwargs):
10+
params = request.env["ir.config_parameter"].sudo()
11+
return {
12+
"forbidden_extensions": params.get_param(
13+
"dms.forbidden_extensions", default=""
14+
)
15+
}

0 commit comments

Comments
 (0)