Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions checklog-odoo.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[checklog-odoo]
ignore=
WARNING.* 0 failed, 0 error\(s\).*
WARNING .* Killing chrome descendants-or-self .*
140 changes: 72 additions & 68 deletions dms/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========================
Document Management System
==========================
Expand All @@ -7,23 +11,23 @@ Document Management System
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:966c4331ff7c75b1ea8cb1d065c878d81250957cd305a5d6422def133e2a7d63
!! source digest: sha256:451b6d4ca876833e0ac116a7abe59895abb355b15d825ea00d205611a4be8c70
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdms-lightgray.png?logo=github
:target: https://github.com/OCA/dms/tree/18.0/dms
:target: https://github.com/OCA/dms/tree/19.0/dms
:alt: OCA/dms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms
:target: https://translation.odoo-community.org/projects/dms-19-0/dms-19-0-dms
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=18.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -68,23 +72,23 @@ To configure this module, you need to:
2. Create a new document storage. You can choose between three options
on ``Save Type``:

- ``Database``: Store the files on the database as a field
- ``Attachment``: Store the files as attachments
- ``File``: Store the files on the file system
- ``Database``: Store the files on the database as a field
- ``Attachment``: Store the files as attachments
- ``File``: Store the files on the file system

2. Create an access group
-------------------------

1. Next, create an administrative access group. Go to *Configuration ->
Access Groups*.

- Create a new group, name it appropriately, and turn on all three
permissions (Create, Write and Unlink. Read is implied and always
enabled).
- Add any other top-level administrative users to the group if
needed (your user should already be there).
- You can create other groups in here later for fine-grained access
control.
- Create a new group, name it appropriately, and turn on all three
permissions (Create, Write and Unlink. Read is implied and always
enabled).
- Add any other top-level administrative users to the group if needed
(your user should already be there).
- You can create other groups in here later for fine-grained access
control.

3. Create a directory
---------------------
Expand All @@ -94,18 +98,18 @@ To configure this module, you need to:
2. Create a new directory, mark it as root and select the previously
created setting.

- Select the *Groups* tab and add your administrative group created
above. If your directory was already created before the group, you
can also add it in the access groups (*Configuration -> Access
Groups*).
- Select the *Groups* tab and add your administrative group created
above. If your directory was already created before the group, you
can also add it in the access groups (*Configuration -> Access
Groups*).

3. In the directory settings, you can also add other access groups
(created above) that will be able to:

- read
- create
- write
- delete
- read
- create
- write
- delete

Migration
=========
Expand Down Expand Up @@ -151,36 +155,36 @@ access to that resource, no matter if logged or not.
Known issues / Roadmap
======================

- Files preview in portal
- Allow to download folder in portal and create zip file with all
content
- Save in cache own_root directories and update in every
create/write/unlink function
- Add a migration procedure for converting an storage to attachment one
for populating existing records with attachments as folders
- Add a link from attachment view in chatter to linked documents
- If Inherit permissions from related record (the
inherit_access_from_parent_record field from storage) is changed when
directories already exist, inconsistencies may occur because groups
defined in the directories and subdirectories will still exist, all
groups in these directories should be removed before changing.
- Since portal users can read ``dms.storage`` records, if your module
extends this model to another storage backend that needs using
secrets, remember to forbid access to the secrets fields by other
means. It would be nice to be able to remove that rule at some point.
- Searchpanel in files: Highlight items (shading) without records when
filtering something (by name for example).
- Accessing the clipboard (for example copy share link of
file/directory) is limited to secure connections. It also happens in
any part of Odoo.
- Files preview in portal
- Allow to download folder in portal and create zip file with all
content
- Save in cache own_root directories and update in every
create/write/unlink function
- Add a migration procedure for converting an storage to attachment one
for populating existing records with attachments as folders
- Add a link from attachment view in chatter to linked documents
- If Inherit permissions from related record (the
inherit_access_from_parent_record field from storage) is changed when
directories already exist, inconsistencies may occur because groups
defined in the directories and subdirectories will still exist, all
groups in these directories should be removed before changing.
- Since portal users can read ``dms.storage`` records, if your module
extends this model to another storage backend that needs using
secrets, remember to forbid access to the secrets fields by other
means. It would be nice to be able to remove that rule at some point.
- Searchpanel in files: Highlight items (shading) without records when
filtering something (by name for example).
- Accessing the clipboard (for example copy share link of
file/directory) is limited to secure connections. It also happens in
any part of Odoo.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/dms/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`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**>`_.
`feedback <https://github.com/OCA/dms/issues/new?body=module:%20dms%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -196,40 +200,40 @@ Authors
Contributors
------------

- Mathias Markl <mathias.markl@mukit.at>
- Enric Tobella <etobella@creublanca.es>
- Antoni Romera
- Gelu Boros <gelu.boros@rgbconsulting.com>
- `Tecnativa <https://www.tecnativa.com>`__:
- Mathias Markl <mathias.markl@mukit.at>
- Enric Tobella <etobella@creublanca.es>
- Antoni Romera
- Gelu Boros <gelu.boros@rgbconsulting.com>
- `Tecnativa <https://www.tecnativa.com>`__:

- Víctor Martínez
- Pedro M. Baeza
- Jairo Llopis
- Víctor Martínez
- Pedro M. Baeza
- Jairo Llopis

- `Elego <https://www.elegosoft.com>`__:
- `Elego <https://www.elegosoft.com>`__:

- Yu Weng <yweng@elegosoft.com>
- Philip Witte <phillip.witte@elegosoft.com>
- Khanh Bui <khanh.bui@mail.elegosoft.com>
- Yu Weng <yweng@elegosoft.com>
- Philip Witte <phillip.witte@elegosoft.com>
- Khanh Bui <khanh.bui@mail.elegosoft.com>

- `Subteno <https://www.subteno.com>`__:
- `Subteno <https://www.subteno.com>`__:

- Timothée Vannier <tva@subteno.com>
- Timothée Vannier <tva@subteno.com>

- `Kencove <https://www.kencove.com>`__:
- `Kencove <https://www.kencove.com>`__:

- Mohamed Alkobrosli <malkobrosly@kencove.com>
- Mohamed Alkobrosli <malkobrosly@kencove.com>

Other credits
-------------

Some pictures are based on or inspired by:

- `Roundicons <https://www.flaticon.com/authors/roundicons>`__
- `Smashicons <https://www.flaticon.com/authors/smashicons>`__
- `EmojiOne <https://github.com/EmojiTwo/emojitwo>`__ : Portal DMS icon
- `GitHub Octicons <https://github.com/primer/octicons/>`__ : The main
DMS icon
- `Roundicons <https://www.flaticon.com/authors/roundicons>`__
- `Smashicons <https://www.flaticon.com/authors/smashicons>`__
- `EmojiOne <https://github.com/EmojiTwo/emojitwo>`__ : Portal DMS icon
- `GitHub Octicons <https://github.com/primer/octicons/>`__ : The main
DMS icon

Maintainers
-----------
Expand All @@ -244,6 +248,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/dms <https://github.com/OCA/dms/tree/18.0/dms>`_ project on GitHub.
This module is part of the `OCA/dms <https://github.com/OCA/dms/tree/19.0/dms>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions dms/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

{
"name": "Document Management System",
"summary": """Document Management System for Odoo""",
"version": "18.0.1.0.0",
"summary": "Document Management System for Odoo",
"version": "19.0.1.0.0",
"category": "Document Management",
"license": "LGPL-3",
"website": "https://github.com/OCA/dms",
Expand Down
14 changes: 10 additions & 4 deletions dms/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import json
import unicodedata

from odoo import _, http
from odoo import http
from odoo.exceptions import AccessError
from odoo.http import request

from odoo.addons.web.controllers.binary import clean


class OnboardingController(http.Controller):
@http.route("/config/dms.forbidden_extensions", type="json", auth="user")
@http.route("/config/dms.forbidden_extensions", type="jsonrpc", auth="user")
def forbidden_extensions(self, **_kwargs):
params = request.env["ir.config_parameter"].sudo()
return {
Expand Down Expand Up @@ -49,9 +49,15 @@ def upload_dms_file(self, ufile, directory_id, callback=None):
}
)
except AccessError:
args.append({"error": _("You are not allowed to upload a file here.")})
args.append(
{
"error": request.env._(
"You are not allowed to upload a file here."
)
}
)
except Exception:
args.append({"error": _("Something horrible happened")})
args.append({"error": request.env._("Something horrible happened")})
else:
args.append(
{
Expand Down
18 changes: 10 additions & 8 deletions dms/controllers/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import base64
from typing import Optional # noqa # pylint: disable=unused-import

from odoo import _, http
from odoo import http
from odoo.fields import Domain
from odoo.http import content_disposition, request
from odoo.osv.expression import OR

from odoo.addons.portal.controllers.portal import CustomerPortal
from odoo.addons.web.controllers.utils import ensure_db
Expand Down Expand Up @@ -64,12 +64,12 @@ def portal_my_dms(
sortby,
) = self._searchbar_data(filterby, sortby)
# domain
domain = [
("id", "in", request.env["dms.directory"]._get_own_root_directories()),
]
domain = Domain(
[("id", "in", request.env["dms.directory"]._get_own_root_directories())]
)
# search
if search and search_in == "name":
domain += OR([[], [("name", "ilike", search)]])
domain = Domain.AND([domain, Domain.OR([[], [("name", "ilike", search)]])])
# content according to pager and archive selected
items = request.env["dms.directory"].search(domain, order=sort_order)
request.session["my_dms_folder_history"] = items.ids
Expand Down Expand Up @@ -235,14 +235,16 @@ def _searchbar_data(self, filterby, sortby):
sortby
:rtype: tuple[str, dict, dict, str, str]
"""
searchbar_sortings = {"name": {"label": _("Name"), "order": "name asc"}}
searchbar_sortings = {
"name": {"label": request.env._("Name"), "order": "name asc"}
}
# default sortby
if not sortby:
sortby = "name"
sort_order = searchbar_sortings[sortby]["order"]
# search
searchbar_inputs = {
"name": {"input": "name", "label": _("Name")},
"name": {"input": "name", "label": request.env._("Name")},
}
if not filterby:
filterby = "name"
Expand Down
2 changes: 1 addition & 1 deletion dms/demo/res_users.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
-->
<odoo noupdate="1">
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('dms.group_dms_user'))]" name="groups_id" />
<field eval="[(4, ref('dms.group_dms_user'))]" name="group_ids" />
</record>
</odoo>
Loading
Loading