Skip to content

Commit daad7a0

Browse files
authored
Merge branch 'OCA:18.0' into 18.0
2 parents 6481f16 + d4b9c0c commit daad7a0

24 files changed

Lines changed: 421 additions & 438 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Available addons
2222
----------------
2323
addon | version | maintainers | summary
2424
--- | --- | --- | ---
25-
[dms](dms/) | 18.0.1.0.8 | | Document Management System for Odoo
25+
[dms](dms/) | 18.0.1.1.0 | | Document Management System for Odoo
2626
[dms_auto_classification](dms_auto_classification/) | 18.0.1.0.1 | <a href='https://github.com/victoralmau'><img src='https://github.com/victoralmau.png' width='32' height='32' style='border-radius:50%;' alt='victoralmau'/></a> | Auto classify documents into DMS
27-
[dms_field](dms_field/) | 18.0.1.1.4 | <a href='https://github.com/CarlosRoca13'><img src='https://github.com/CarlosRoca13.png' width='32' height='32' style='border-radius:50%;' alt='CarlosRoca13'/></a> | Create DMS View and allow to use them inside a record
27+
[dms_field](dms_field/) | 18.0.1.2.0 | <a href='https://github.com/CarlosRoca13'><img src='https://github.com/CarlosRoca13.png' width='32' height='32' style='border-radius:50%;' alt='CarlosRoca13'/></a> | Create DMS View and allow to use them inside a record
2828
[dms_field_auto_classification](dms_field_auto_classification/) | 18.0.1.0.1 | <a href='https://github.com/victoralmau'><img src='https://github.com/victoralmau.png' width='32' height='32' style='border-radius:50%;' alt='victoralmau'/></a> | Auto classify files into embedded DMS
2929
[dms_user_role](dms_user_role/) | 18.0.1.0.0 | <a href='https://github.com/victoralmau'><img src='https://github.com/victoralmau.png' width='32' height='32' style='border-radius:50%;' alt='victoralmau'/></a> | DMS User Role
3030
[hr_dms_field](hr_dms_field/) | 18.0.1.0.0 | <a href='https://github.com/victoralmau'><img src='https://github.com/victoralmau.png' width='32' height='32' style='border-radius:50%;' alt='victoralmau'/></a> | Add dms field for employees

dms/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Document Management System
1111
!! This file is generated by oca-gen-addon-readme !!
1212
!! changes will be overwritten. !!
1313
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14-
!! source digest: sha256:451b6d4ca876833e0ac116a7abe59895abb355b15d825ea00d205611a4be8c70
14+
!! source digest: sha256:fdc471fc203e1eb7937756380169eb3069d55ae6e858b0ab2360b45775d536d5
1515
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1616
1717
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png

dms/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "Document Management System",
77
"summary": """Document Management System for Odoo""",
8-
"version": "18.0.1.0.8",
8+
"version": "18.0.1.1.0",
99
"category": "Document Management",
1010
"license": "LGPL-3",
1111
"website": "https://github.com/OCA/dms",

dms/controllers/main.py

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# Copyright 2017-2019 MuK IT GmbH
2+
# Copyright 2026 Tecnativa - Víctor Martínez
23
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3-
from odoo import http
4+
import json
5+
import unicodedata
6+
7+
from odoo import _, http
8+
from odoo.exceptions import AccessError
49
from odoo.http import request
510

11+
from odoo.addons.web.controllers.binary import clean
12+
613

714
class OnboardingController(http.Controller):
815
@http.route("/config/dms.forbidden_extensions", type="json", auth="user")
@@ -13,3 +20,49 @@ def forbidden_extensions(self, **_kwargs):
1320
"dms.forbidden_extensions", default=""
1421
)
1522
}
23+
24+
@http.route("/web/binary/upload_dms_file", type="http", auth="user")
25+
def upload_dms_file(self, ufile, directory_id, callback=None):
26+
"""Similar to the web upload_attachment() method, but customized to
27+
directly create dms.file records.
28+
"""
29+
directory_id = int(directory_id)
30+
files = request.httprequest.files.getlist("ufile")
31+
Model = request.env["dms.file"]
32+
out = """<script language="javascript" type="text/javascript">
33+
var win = window.top.window;
34+
win.jQuery(win).trigger(%s, %s);
35+
</script>"""
36+
args = []
37+
for ufile in files:
38+
filename = ufile.filename
39+
if request.httprequest.user_agent.browser == "safari":
40+
# Safari sends NFD UTF-8 (where é is composed by 'e' and [accent])
41+
# we need to send it the same stuff, otherwise it'll fail
42+
filename = unicodedata.normalize("NFD", ufile.filename)
43+
try:
44+
dms_file = Model.create(
45+
{
46+
"directory_id": directory_id,
47+
"name": filename,
48+
"content_binary": ufile.read(),
49+
}
50+
)
51+
except AccessError:
52+
args.append({"error": _("You are not allowed to upload a file here.")})
53+
except Exception:
54+
args.append({"error": _("Something horrible happened")})
55+
else:
56+
args.append(
57+
{
58+
"filename": clean(filename),
59+
"mimetype": dms_file.mimetype,
60+
"id": dms_file.id,
61+
"size": dms_file.size,
62+
}
63+
)
64+
return (
65+
out % (json.dumps(clean(callback)), json.dumps(args))
66+
if callback
67+
else json.dumps(args)
68+
)

dms/i18n/ar.po

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ msgstr ""
2222
msgid ""
2323
" Define how incoming emails are processed:\n"
2424
"\n"
25-
" - Single Files: The email gets attached to the directory and\n"
25+
" - Single Files: The email gets attached to the directory "
26+
"and\n"
2627
" all attachments are created as files.\n"
2728
"\n"
28-
" - Subdirectory: A new subdirectory is created for each email\n"
29-
" and the mail is attached to this subdirectory. The attachments\n"
29+
" - Subdirectory: A new subdirectory is created for each "
30+
"email\n"
31+
" and the mail is attached to this subdirectory. The "
32+
"attachments\n"
3033
" are created as files of the subdirectory.\n"
3134
" "
3235
msgstr ""
@@ -89,9 +92,12 @@ msgstr ""
8992
#: model_terms:ir.ui.view,arch_db:dms.wizard_dms_file_move_form_view
9093
msgid ""
9194
"<i class=\"fa fa-exclamation-triangle mr-3\" title=\"Warning\"/>\n"
92-
" <b>ATTENTION:</b> Tips to keep in mind before moving files:<br/>\n"
95+
" <b>ATTENTION:</b> Tips to keep in mind before moving "
96+
"files:<br/>\n"
9397
" - This change cannot be undone.<br/>\n"
94-
" - Remember that the permissions of the files are those of the folder that contains it, therefore, it is possible that when you change it, the permissions will also change.<br/>\n"
98+
" - Remember that the permissions of the files are those "
99+
"of the folder that contains it, therefore, it is possible that when you "
100+
"change it, the permissions will also change.<br/>\n"
95101
" Make this change at your own risk."
96102
msgstr ""
97103
"<i class=\"fa fa-exclamation-triangle mr-3\" title=\"تحذير\"/>\n"
@@ -202,7 +208,8 @@ msgstr "<span class=\"ms-1\">ملفات</span>"
202208
#: model_terms:ir.ui.view,arch_db:dms.view_dms_directory_form
203209
msgid ""
204210
"<span class=\"oe_read_only\">@</span>\n"
205-
" <span class=\"oe_edit_only\"> @ </span>"
211+
" <span class=\"oe_edit_only\"> @ </"
212+
"span>"
206213
msgstr ""
207214
"<span class=\"oe_read_only\">@</span>\n"
208215
" <span class=\"oe_edit_only\"> @ </"
@@ -439,12 +446,6 @@ msgstr "الكل"
439446
msgid "All Files"
440447
msgstr "جميع الملفات"
441448

442-
#. module: dms
443-
#. odoo-javascript
444-
#: code:addons/dms/static/src/js/views/dms_file_upload.esm.js:0
445-
msgid "An error occurred during the upload"
446-
msgstr "حدث خطأ أثناء الرفع"
447-
448449
#. module: dms
449450
#: model:dms.tag,name:dms.tag_06_demo
450451
msgid "Apps"
@@ -1184,11 +1185,11 @@ msgstr "المعرّف"
11841185
#. module: dms
11851186
#: model:ir.model.fields,help:dms.field_dms_directory__alias_parent_thread_id
11861187
msgid ""
1187-
"ID of the parent record holding the alias (example: project holding the task"
1188-
" creation alias)"
1188+
"ID of the parent record holding the alias (example: project holding the task "
1189+
"creation alias)"
11891190
msgstr ""
1190-
"معرّف السجل الأب الذي يحمل الاسم المستعار (مثال: مشروع يحمل اسم المستعار لإنشاء "
1191-
"المهمة)"
1191+
"معرّف السجل الأب الذي يحمل الاسم المستعار (مثال: مشروع يحمل اسم المستعار "
1192+
"لإنشاء المهمة)"
11921193

11931194
#. module: dms
11941195
#: model:ir.model.fields,field_description:dms.field_dms_directory__activity_exception_icon
@@ -1286,9 +1287,9 @@ msgstr "صورة 512"
12861287
#: model:ir.model.fields,help:dms.field_dms_directory__storage_id_inherit_access_from_parent_record
12871288
#: model:ir.model.fields,help:dms.field_dms_storage__inherit_access_from_parent_record
12881289
msgid ""
1289-
"Indicate if directories and files access work only with related model access"
1290-
" (for example, if some directories are related with any sale, only users "
1291-
"with read access to these sale can access)"
1290+
"Indicate if directories and files access work only with related model access "
1291+
"(for example, if some directories are related with any sale, only users with "
1292+
"read access to these sale can access)"
12921293
msgstr ""
12931294
"يحدد ما إذا كان وصول المجلدات والملفات يعمل فقط وفق صلاحيات النموذج المرتبط "
12941295
"(على سبيل المثال، إذا رُبطت مجلدات بعملية بيع، يمكن للمستخدمين الذين لديهم حق "
@@ -1297,8 +1298,7 @@ msgstr ""
12971298
#. module: dms
12981299
#: model:ir.model.fields,help:dms.field_dms_storage__include_message_attachments
12991300
msgid ""
1300-
"Indicate if directories and files auto-create in mail composition process "
1301-
"too"
1301+
"Indicate if directories and files auto-create in mail composition process too"
13021302
msgstr ""
13031303
"يحدد ما إذا كانت المجلدات والملفات تُنشأ تلقائياً في عملية إنشاء البريد أيضاً"
13041304

@@ -1314,7 +1314,8 @@ msgstr "يشير إلى ما إذا كانت المجلدات والملفات
13141314
#: model:ir.model.fields,help:dms.field_dms_directory__is_root_directory
13151315
msgid ""
13161316
"Indicates if the directory is a root directory.\n"
1317-
" A root directory has a settings object, while a directory with a set\n"
1317+
" A root directory has a settings object, while a directory with a "
1318+
"set\n"
13181319
" parent inherits the settings form its parent."
13191320
msgstr ""
13201321
"يشير إلى ما إذا كان المجلد جذرياً.\n"
@@ -1359,12 +1360,6 @@ msgstr "داخلي"
13591360
msgid "Internal / Human Resource"
13601361
msgstr "داخلي / الموارد البشرية"
13611362

1362-
#. module: dms
1363-
#. odoo-python
1364-
#: code:addons/dms/models/dms_file.py:0
1365-
msgid "Invalid attachments!"
1366-
msgstr "مرفقات غير صالحة!"
1367-
13681363
#. module: dms
13691364
#: model_terms:ir.ui.view,arch_db:dms.view_dms_category_form
13701365
msgid "Invoices"
@@ -1621,12 +1616,6 @@ msgstr "ملخص النشاط التالي"
16211616
msgid "Next Activity Type"
16221617
msgstr "نوع النشاط التالي"
16231618

1624-
#. module: dms
1625-
#. odoo-python
1626-
#: code:addons/dms/models/dms_file.py:0
1627-
msgid "No attachment was provided"
1628-
msgstr "لم يُقدَّم أي مرفق"
1629-
16301619
#. module: dms
16311620
#: model:ir.model.fields.selection,name:dms.selection__res_company__documents_onboarding_directory_state__not_done
16321621
#: model:ir.model.fields.selection,name:dms.selection__res_company__documents_onboarding_file_state__not_done
@@ -1762,8 +1751,8 @@ msgstr "المجموعة الأب '%(parent)s' فرعية لـ '%(current)s'."
17621751
#. module: dms
17631752
#: model:ir.model.fields,help:dms.field_dms_directory__alias_parent_model_id
17641753
msgid ""
1765-
"Parent model holding the alias. The model holding the alias reference is not"
1766-
" necessarily the model given by alias_model_id (example: project "
1754+
"Parent model holding the alias. The model holding the alias reference is not "
1755+
"necessarily the model given by alias_model_id (example: project "
17671756
"(parent_model) and task (model))"
17681757
msgstr ""
17691758
"النموذج الأب الذي يحمل الاسم المستعار. النموذج الذي يحمل مرجع الاسم المستعار "
@@ -1791,7 +1780,8 @@ msgid ""
17911780
"Policy to post a message on the document using the mailgateway.\n"
17921781
"- everyone: everyone can post\n"
17931782
"- partners: only authenticated partners\n"
1794-
"- followers: only followers of the related document or members of following channels\n"
1783+
"- followers: only followers of the related document or members of following "
1784+
"channels\n"
17951785
msgstr ""
17961786
"سياسة نشر رسالة على المستند عبر بوابة البريد.\n"
17971787
"- الجميع: يمكن للجميع النشر\n"
@@ -1971,6 +1961,12 @@ msgstr "الحجم"
19711961
msgid "Size (human readable)"
19721962
msgstr "الحجم (قابل للقراءة)"
19731963

1964+
#. module: dms
1965+
#. odoo-python
1966+
#: code:addons/dms/controllers/main.py:0
1967+
msgid "Something horrible happened"
1968+
msgstr ""
1969+
19741970
#. module: dms
19751971
#: model:ir.model.fields,field_description:dms.field_dms_directory__starred
19761972
#: model_terms:ir.ui.view,arch_db:dms.view_dms_directory_kanban
@@ -2130,9 +2126,9 @@ msgstr "الحد الأقصى لحجم الرفع هو %s ميغابايت."
21302126
#. module: dms
21312127
#: model:ir.model.fields,help:dms.field_dms_directory__alias_model_id
21322128
msgid ""
2133-
"The model (Odoo Document Kind) to which this alias corresponds. Any incoming"
2134-
" email that does not reply to an existing record will cause the creation of "
2135-
"a new record of this model (e.g. a Project Task)"
2129+
"The model (Odoo Document Kind) to which this alias corresponds. Any incoming "
2130+
"email that does not reply to an existing record will cause the creation of a "
2131+
"new record of this model (e.g. a Project Task)"
21362132
msgstr ""
21372133
"النموذج (نوع مستند أودو) الذي يتوافق معه هذا الاسم المستعار. أي بريد وارد لا "
21382134
"يرد على سجل قائم سيؤدي إلى إنشاء سجل جديد من هذا النموذج (مثل مهمة مشروع)"
@@ -2157,8 +2153,8 @@ msgstr "يجب أن يكون اسم المجموعة فريداً!"
21572153
#: model:ir.model.fields,help:dms.field_dms_file__storage_id_save_type
21582154
#: model:ir.model.fields,help:dms.field_dms_storage__save_type
21592155
msgid ""
2160-
"The save type is used to determine how a file is saved by the system. If you"
2161-
" change this setting, you can migrate existing files manually by triggering "
2156+
"The save type is used to determine how a file is saved by the system. If you "
2157+
"change this setting, you can migrate existing files manually by triggering "
21622158
"the action."
21632159
msgstr ""
21642160
"يُستخدم نوع الحفظ لتحديد كيفية حفظ الملف في النظام. عند تغيير هذا الإعداد، "
@@ -2285,6 +2281,12 @@ msgstr "معالج مشاركة سجلات نظام إدارة المستندا
22852281
msgid "Write Access"
22862282
msgstr "صلاحية الكتابة"
22872283

2284+
#. module: dms
2285+
#. odoo-python
2286+
#: code:addons/dms/controllers/main.py:0
2287+
msgid "You are not allowed to upload a file here."
2288+
msgstr ""
2289+
22882290
#. module: dms
22892291
#. odoo-javascript
22902292
#: code:addons/dms/static/src/js/views/dms_file_upload.esm.js:0
@@ -2305,3 +2307,12 @@ msgstr "exe,msi"
23052307
#: model_terms:ir.ui.view,arch_db:dms.view_dms_directory_form
23062308
msgid "mail.catchall.domain"
23072309
msgstr "mail.catchall.domain"
2310+
2311+
#~ msgid "An error occurred during the upload"
2312+
#~ msgstr "حدث خطأ أثناء الرفع"
2313+
2314+
#~ msgid "Invalid attachments!"
2315+
#~ msgstr "مرفقات غير صالحة!"
2316+
2317+
#~ msgid "No attachment was provided"
2318+
#~ msgstr "لم يُقدَّم أي مرفق"

dms/i18n/de.po

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,6 @@ msgstr "Alle"
418418
msgid "All Files"
419419
msgstr "Alle Dateien"
420420

421-
#. module: dms
422-
#. odoo-javascript
423-
#: code:addons/dms/static/src/js/views/dms_file_upload.esm.js:0
424-
msgid "An error occurred during the upload"
425-
msgstr "Während des Uploads ist ein Fehler aufgetreten"
426-
427421
#. module: dms
428422
#: model:dms.tag,name:dms.tag_06_demo
429423
msgid "Apps"
@@ -1345,12 +1339,6 @@ msgstr "Intern"
13451339
msgid "Internal / Human Resource"
13461340
msgstr "Interne / Personal-Ressource"
13471341

1348-
#. module: dms
1349-
#. odoo-python
1350-
#: code:addons/dms/models/dms_file.py:0
1351-
msgid "Invalid attachments!"
1352-
msgstr "Ungültige Anhänge!"
1353-
13541342
#. module: dms
13551343
#: model_terms:ir.ui.view,arch_db:dms.view_dms_category_form
13561344
msgid "Invoices"
@@ -1607,12 +1595,6 @@ msgstr "Zusammenfassung der nächsten Aktivität"
16071595
msgid "Next Activity Type"
16081596
msgstr "Typ der nächsten Aktivität"
16091597

1610-
#. module: dms
1611-
#. odoo-python
1612-
#: code:addons/dms/models/dms_file.py:0
1613-
msgid "No attachment was provided"
1614-
msgstr "Es wurde kein zur Verfügung gestellt"
1615-
16161598
#. module: dms
16171599
#: model:ir.model.fields.selection,name:dms.selection__res_company__documents_onboarding_directory_state__not_done
16181600
#: model:ir.model.fields.selection,name:dms.selection__res_company__documents_onboarding_file_state__not_done
@@ -1962,6 +1944,12 @@ msgstr "Größe"
19621944
msgid "Size (human readable)"
19631945
msgstr ""
19641946

1947+
#. module: dms
1948+
#. odoo-python
1949+
#: code:addons/dms/controllers/main.py:0
1950+
msgid "Something horrible happened"
1951+
msgstr ""
1952+
19651953
#. module: dms
19661954
#: model:ir.model.fields,field_description:dms.field_dms_directory__starred
19671955
#: model_terms:ir.ui.view,arch_db:dms.view_dms_directory_kanban
@@ -2280,6 +2268,12 @@ msgstr ""
22802268
msgid "Write Access"
22812269
msgstr "Schreibberechtigung"
22822270

2271+
#. module: dms
2272+
#. odoo-python
2273+
#: code:addons/dms/controllers/main.py:0
2274+
msgid "You are not allowed to upload a file here."
2275+
msgstr ""
2276+
22832277
#. module: dms
22842278
#. odoo-javascript
22852279
#: code:addons/dms/static/src/js/views/dms_file_upload.esm.js:0
@@ -2301,6 +2295,15 @@ msgstr "exe, msi"
23012295
msgid "mail.catchall.domain"
23022296
msgstr ""
23032297

2298+
#~ msgid "An error occurred during the upload"
2299+
#~ msgstr "Während des Uploads ist ein Fehler aufgetreten"
2300+
2301+
#~ msgid "Invalid attachments!"
2302+
#~ msgstr "Ungültige Anhänge!"
2303+
2304+
#~ msgid "No attachment was provided"
2305+
#~ msgstr "Es wurde kein zur Verfügung gestellt"
2306+
23042307
#~ msgid "Actions"
23052308
#~ msgstr "Aktionen"
23062309

0 commit comments

Comments
 (0)