Skip to content

Commit

Permalink
Merge PR #262 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 3, 2023
2 parents 282844d + 05f7c67 commit 4101217
Show file tree
Hide file tree
Showing 205 changed files with 30,779 additions and 0 deletions.
187 changes: 187 additions & 0 deletions dms/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
==========================
Document Management System
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b1e60e0ea0e646cb5b470ed09f40c4175157a6b0e310b6e9ea7352fb5014f9bd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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
: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/15.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-15-0/dms-15-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=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

DMS is a module for creating, managing and viewing document files directly
within Odoo.
This module is only the basis for an entire ecosystem of apps that extend and
seamlessly integrate with the document management system.

This module adds portal functionality for directories and files for allowed users, both portal or internal users. You can get as well a tokenized link from a directory or a file for sharing it with any anonymous user.

**Table of contents**

.. contents::
:local:

Installation
============

Preview
~~~~~~~

``mail_preview_base`` is required for DMS but it is recommended to install all
the other `mail_preview` modules from `social` OCA repository
in order to improve the preview of files.

``python-magic`` library is recommended to be installed for having whole support
to get proper file types and file preview.

Configuration
=============

To configure this module, you need to:

#. Go to *Documents -> Configuration -> Storages*.
#. Create a new document storage. You can choose between two options on `Save Type`:
* `Database`: Store the files on the database as a field
* `Attachment`: Store the files as attachments
#. 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.
#. Afterwards go to *Documents -> Directories*.
#. 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.
#. On the Directory you can also add other access groups (created above) that will be able to:
* read
* create
* write
* delete


Migration
~~~~~~~~~

If you need to modify the storage Save Type you might want to migrate the file data.
In order to achieve it you need to:

#. Go to *Documents -> Configuration -> Storage* and select the storage you want to modify
#. Modify the save type
#. Press the button `Migrate files` if you want to migrate all the files at once
#. Press the button `Manual File Migration` in order to specify files one by one

You can check all the files that still needs to be migrated from all storages
and migrate them manually on *Documents -> Configuration -> Migration*


File Wizard Selection
~~~~~~~~~~~~~~~~~~~~~

There is an action called `action_dms_file_wizard_selector` to open a wizard to list files in kanban view.
This can be used (example `dms_attachment_link` module) to add a button in kanban view with the action we need.

Usage
=====

The best way to manage the documents is to switch to the Documents view.
Existing documents can be managed there and new documents can be created.

Portal functionality
~~~~~~~~~~~~~~~~~~~~

You can add any portal user to DMS access groups, and then allow that group in directories, so they will see in the portal such directories and their files.
Another possibility is to click on "Share" button inside a directory or a file for obtaining a tokenized link for single 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.

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:%2015.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.

Credits
=======

Authors
~~~~~~~

* MuK IT
* Tecnativa

Contributors
~~~~~~~~~~~~

* Mathias Markl <[email protected]>
* Enric Tobella <[email protected]>
* Antoni Romera
* Gelu Boros <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

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

* `Elego <https://www.elegosoft.com>`_:

* Yu Weng <[email protected]>
* Philip Witte <[email protected]>
* Khanh Bui <[email protected]>

Other credits
~~~~~~~~~~~~~

Some pictures are based on or inspired by:

* `Roundicons <https://www.flaticon.com/authors/roundicons>`_
* `Smashicons <https://www.flaticon.com/authors/smashicons>`_

The migration of this module from 15.0 to 16.0 was finanically supported by `AgentERP <https://www.agenterp.com>`_

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/15.0/dms>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions dms/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
58 changes: 58 additions & 0 deletions dms/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2017-2019 MuK IT GmbH
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Document Management System",
"summary": """Document Management System for Odoo""",
"version": "16.0.1.0.0",
"category": "Document Management",
"license": "LGPL-3",
"website": "https://github.com/OCA/dms",
"author": "MuK IT, Tecnativa, Odoo Community Association (OCA)",
"depends": [
"mail",
"http_routing",
"portal",
"base",
],
"data": [
"security/security.xml",
"security/ir.model.access.csv",
"actions/file.xml",
"template/onboarding.xml",
"views/menu.xml",
"views/tag.xml",
"views/category.xml",
"views/dms_file.xml",
"views/directory.xml",
"views/storage.xml",
"views/dms_access_groups_views.xml",
"views/res_config_settings.xml",
"views/dms_portal_templates.xml",
],
"assets": {
"mail.assets_messaging": [
("include", "mail.assets_core_messaging"),
"dms/static/src/models/*.js",
],
"web.assets_backend": [
"dms/static/src/scss/*",
"dms/static/src/js/fields/*",
"dms/static/src/js/views/*.esm.js",
"dms/static/src/js/views/*.xml",
"dms/static/src/js/views/fields/binary/*",
],
"web.assets_frontend": ["dms/static/src/js/dms_portal_tour.js"],
},
"demo": [
"demo/res_users.xml",
"demo/access_group.xml",
"demo/category.xml",
"demo/tag.xml",
"demo/storage.xml",
"demo/directory.xml",
"demo/file.xml",
],
"images": ["static/description/banner.png"],
"application": True,
}
16 changes: 16 additions & 0 deletions dms/actions/file.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2017-2019 MuK IT GmbH
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
-->
<odoo>
<record id="action_dms_attachment_migrate" model="ir.actions.server">
<field name="name">Migrate</field>
<field name="model_id" ref="model_dms_file" />
<field name="binding_model_id" ref="dms.model_dms_file" />
<field name="state">code</field>
<field name="code">records.action_migrate()</field>
</record>
</odoo>
2 changes: 2 additions & 0 deletions dms/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import main
from . import portal
49 changes: 49 additions & 0 deletions dms/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2017-2019 MuK IT GmbH
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import http
from odoo.http import request


class OnboardingController(http.Controller):
@http.route("/dms/document_onboarding/directory", auth="user", type="json")
def document_onboarding_directory(self):
company = request.env.user.company_id
closed = company.documents_onboarding_state == "closed"
check = request.env.user.has_group("dms.group_dms_manager")
if check and not closed:
return {
"html": request.env["ir.qweb"]._render(
request.env.ref("dms.document_onboarding_directory_panel").id,
{
"state": company.get_and_update_documents_onboarding_state(),
"company": company,
},
)
}
return {}

@http.route("/dms/document_onboarding/file", auth="user", type="json")
def document_onboarding_file(self):
company = request.env.user.company_id
closed = company.documents_onboarding_state == "closed"
check = request.env.user.has_group("dms.group_dms_manager")
if check and not closed:
return {
"html": request.env["ir.qweb"]._render(
request.env.ref("dms.document_onboarding_file_panel").id,
{
"state": company.get_and_update_documents_onboarding_state(),
"company": company,
},
)
}
return {}

@http.route("/config/dms.forbidden_extensions", type="json", auth="user")
def forbidden_extensions(self, **_kwargs):
params = request.env["ir.config_parameter"].sudo()
return {
"forbidden_extensions": params.get_param(
"dms.forbidden_extensions", default=""
)
}
Loading

0 comments on commit 4101217

Please sign in to comment.