Git Product home page Git Product logo

dms's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

dms

TODO: add repo description.

Available addons

addon version maintainers summary
dms 15.0.1.13.0 Document Management System for Odoo
dms_attachment_link 15.0.1.0.0 victoralmau Dms Attachment Link
dms_auto_classification 15.0.1.0.1 victoralmau Auto classify documents into DMS
dms_field 15.0.1.3.1 Create DMS View and allow to use them inside a record
dms_field_auto_classification 15.0.1.0.0 victoralmau Auto classify files into embedded DMS
dms_user_role 15.0.1.0.0 victoralmau DMS User Role
hr_dms_field 15.0.1.1.0 victoralmau Add dms field for employees

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


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.

dms's People

Contributors

aleuffre avatar bosd avatar carlosroca13 avatar carolinafernandez-tecnativa avatar etobella avatar francesco-ooops avatar gdrius avatar ivorra78 avatar jackjack82 avatar jasminsforgeflow avatar joao-p-marques avatar keshrath avatar loisrforgeflow avatar luismalta avatar majenkotech avatar marcelsavegnago avatar marylla avatar mymage avatar nicolas-burel avatar oca-git-bot avatar oca-transbot avatar olgamarcocb avatar pedrobaeza avatar picchiseba avatar shide avatar tardo avatar victoralmau avatar weblate avatar ygol avatar zodk2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dms's Issues

permission rights

Hello,

all new to dms v14 on odoo CE 14, first install now finally works and shows up, allthough I can't create folders and uploads docs

`Due to security restrictions, you are not allowed to create 'Directory' (dms.directory) records.

Records: messmedia (id=8)
User: Administrator (id=2)

This restriction is due to the following rules:

  • Apply computed create permissions.

Contact your administrator to request access if necessary.`

odoo 14 error

odoo-14.0\odoo-14.0\odoo\http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
TypeError: can only concatenate tuple (not "list") to tuple

Error clicking app menu

Traceabilidade:
TypeError: values.forEach is not a function
at SearchPanelModelExtension._createFilterTree (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2030:8)
at https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2041:581
at async Promise.all (index 0)
at async SearchPanelModelExtension._fetchFilters (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2041:48)
at async SearchPanelModelExtension._fetchSections (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2042:118)
at async SearchPanelModelExtension.load (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2013:119)
at async SearchPanelModelExtension.callLoad (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:1301:66)
at async SearchPanelModelExtension.callLoad (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2086:564)
at async SearchPanelModelExtension.callLoad (https://obm.opencloud.pro/web/content/378-ba8a7de/web.assets_backend.js:2007:62)
at async Promise.all (index 0)

Drag and Drop doesn't work

Hey everyone,

I installed this module in my local environment and I am experiencing a rather strange issue.
When I try to drag and drop a file, it's asking me for a directory even tho I selected that one in the sidebar.
How do I tell the system to which directory save the file?
This is what I'm doing:

  • Choose the directory from the sidebar
  • Drag the file from my directory
  • Drop the file
    And I'm getting back the error You must select a directory first

58cf8481-fec5-4c02-b3bf-45bc415abb9e

My question is: is this a bug or there is another way to drag&drop the file?

[13.0] Filestore Data?

When you create a Filestore Storage, where will be saved the files? I can't find anything about it. Thanks

Record Rules Bug

Hi,

I've spent a couple of hours and can't seem to track this down.

Have a setup of say
Root -> Dir A -> Subdir x
-> Dir B -> Subdir y

So A and B are root directories and they have Security Group A and B with read access respectively as well as an admin group with CRUD. inherit groups is set on subdir x and y.

Security group A and B each contain 1 user - User A, and User B.
Both users have Documents/User access rights.

Clicking the Documents Tile as one of those users - Record Rule error - read on Directory
Cut and paste a known good link to the files kanban - Record Rule error - read on Directory
Cut and paste a known good link to the directories kanban - works as expected.

Support attachment categorization / tags?

I would like to be able to categorize and/or tag attachments (primarily on products but more general approach is fine). The reason is there are many kinds of documents for products we sell like user manuals, technical manuals, schemas, guarantee certificates, other certificates... We'd need a flexible way to group/filter these to be able to quickly find what is needed. I'd also use it for filtering documents that should be displayed on website - some in shop, some in customer portal, ...

Currently reviewed PR #9 integrates ir.attachments into DMS which provides both categories and tags. However looking at the code the integration goes in opposite direction - DMS document points to ir.attachment not the opposite way around. The ideal outcome would be changed view on attachments, where one would at least see (edit optionally - but that could be done in DMS as it is currently) category and tags. So these would be available as attributes of the ir.attachment so they could be used elsewhere as well.

Is this feasible or stupid idea?

12.0 : Unable to load picture document

When I try tu upload a picture on a document (to replace the document type icon), I recieve this error :

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/.repo_requirements/odoo/odoo/api.py", line 1049, in get
    value = self._data[key][field][record._ids[0]]
KeyError: 27

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.repo_requirements/odoo/odoo/fields.py", line 1028, in __get__
    value = record.env.cache.get(record, self)
  File "/.repo_requirements/odoo/odoo/api.py", line 1051, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('dms.file(27,).thumbnail', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.repo_requirements/odoo/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/.repo_requirements/odoo/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/.repo_requirements/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/.repo_requirements/odoo/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/.repo_requirements/odoo/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/service/model.py", line 98, in wrapper
    return f(dbname, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/.repo_requirements/odoo/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/.repo_requirements/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo-12.0/addons/web/controllers/main.py", line 962, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odoo-12.0/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/.repo_requirements/odoo/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/.repo_requirements/odoo/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo/build/OCA/dms/dms/models/dms_file.py", line 437, in read
    return super(File, self).read(fields, load=load)
  File "/.repo_requirements/odoo/odoo/models.py", line 2820, in read
    vals[name] = convert(record[name], record, use_name_get)
  File "/.repo_requirements/odoo/odoo/models.py", line 5148, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/.repo_requirements/odoo/odoo/fields.py", line 1032, in __get__
    self.determine_value(record)
  File "/.repo_requirements/odoo/odoo/fields.py", line 1145, in determine_value
    self.compute_value(recs)
  File "/.repo_requirements/odoo/odoo/fields.py", line 1099, in compute_value
    self._compute_value(records)
  File "/.repo_requirements/odoo/odoo/fields.py", line 1090, in _compute_value
    getattr(records, self.compute)()
  File "/home/odoo/build/OCA/dms/dms/models/mixins_thumbnail.py", line 83, in _compute_thumbnail
    record.thumbnail, return_big=True, avoid_resize_medium=True
  File "/.repo_requirements/odoo/odoo/tools/image.py", line 292, in image_get_resized_images
    return_dict[big_name] = image_resize_image_big(base64_source, avoid_if_small=avoid_resize_big, size=size_big)
  File "/.repo_requirements/odoo/odoo/tools/image.py", line 168, in image_resize_image_big
    return image_resize_image(base64_source, size, encoding, filetype, avoid_if_small)
  File "/.repo_requirements/odoo/odoo/tools/image.py", line 69, in image_resize_image
    image = Image.open(image_stream)
  File "/.repo_requirements/virtualenv/python3.5/lib/python3.5/site-packages/PIL/Image.py", line 2349, in open
    % (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x7f64bd4172b0>

uploading a file will overwrite the filename

since the upload of a file will overwrite or set the name, it should either be the first step instead of asking for name, or it should respect the name already typed in.

typing in a name, than uploading the file, the name previous name is overwritten by the filename. should only happen if the name field is empty / null.

upload file problem

hi
When the file size is more than 5 megabytes, the connection to the server is lost and it is unable to upload
image
Connection lost Attempt to reconnect...

[13.0] Record Ref selection bug

With attachment type storage, cannot open files and directories, because record_ref fields have "selection=[ ]".

In local i solved with a function like this:

@api.model
def _get_ref_selection(self):
    models = self.env['ir.model'].search([])
    return [(model.model, model.name) for model in models]

Hope is useful

WARNING popup on dms directory

I just clone version 13.0 from this repository and install the dms 13.0.3.0.2 module.

But every time I try to create or write a dms.directory record, this warning message keeps opening

dms.directory(<NewId 0x7f53c1230438>,).parent_id

image

dms file path

How to get file path when file store type is filestore?
please suggest me.

Thank You

Install for Odoo 14

Hello,
I'm a beginner in odoo development,
And I would really appreciate if someone can help me to install this DMS for Odoo (version 14)

Is there a REST-API to upload/download files?

Is your feature request related to a problem?
Is there a REST-API to upload/download files? I couldn't find a documentation for a REST-API to up- and download files.

If there is no REST-API integrated yet, is someone willing to do this for money?

[Question] why content field is compulsory

Is it on purpose to require the "content" field to be populated when creating a document?

If it wasn't we could create a "placeholder" document before actually receiving it.
Same as "request document" in enterprise's document application.

thanks

extension is needed in filename

the field name contains also the extension. If you remove the .pdf for example, the extension is no longer set, the preview thumb is gone and a notification is showing up.

there should be seperate field, where you can set or edit the real filename with extension. the name of the record should be whatever the user wants to type in without extension.

Screen.Recording.2021-07-22.at.00.30.05.mov

Unable to create root directory

I have just freshly installed (version 14.0.4.0.0 in Odoo 14). Made the store fine. Then I go to try and create the root folder, and it tells me:

Due to security restrictions, you are not allowed to create 'Directory' (dms.directory) records.

Records: root (id=5)
User: Matt Jenkins (id=2)

This restriction is due to the following rules:
- Apply computed create permissions.

Contact your administrator to request access if necessary.

I checked my permissions and I have "dms_directory_base_user" and "dms_directory_user". I even tried restarting odoo to ensure all permissions were flushed and known about by the system.

number of files in not showing up in root directory

the number of files is showing 0 (zero) although there are 2 files in a subdirectory.

| folder 1 (o files
|- subfolder 1 (no files)
|-- subsubfolder (with 2 files)
|---file 1
|---file 2

to be honest, that could lead to the assumption sooner or later, the directory is empty so i can delete it. if a subfolder contains a file, that number should appear in the root folder as well.

Screenshot 2021-07-22 at 00 09 47

Screenshot 2021-07-22 at 00 15 28

DMS with Odoo 14. Community version install error

I just tried to install DMS on the odoo community version 14.
I manually install web_drop_target and mail_preview_base as asked to do so, before installing dms. DMS appears in the menu list as installed, as soon as I click on it i get an error message saying:

Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 912, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1377, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1369, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 392, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 365, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/addons/dms/models/dms_file.py", line 286, in search_panel_select_range
field_name, **kwargs
File "/opt/odoo/odoo/addons/web/models/models.py", line 523, in search_panel_select_range
set_limit= limit and not (expand or hierarchize or comodel_domain), **kwargs
File "/opt/odoo/odoo/addons/web/models/models.py", line 265, in _search_panel_field_image
set_limit and limit,
File "/opt/odoo/odoo/addons/web/models/models.py", line 307, in _search_panel_domain_image
groups = self.read_group(domain, [field_name], [field_name], limit=limit)
File "/opt/odoo/odoo/odoo/models.py", line 2250, in read_group
result = self._read_group_raw(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
File "/opt/odoo/odoo/odoo/models.py", line 2278, in _read_group_raw
annotated_groupbys = [self._read_group_process_groupby(gb, query) for gb in groupby_list]
File "/opt/odoo/odoo/odoo/models.py", line 2278, in
annotated_groupbys = [self._read_group_process_groupby(gb, query) for gb in groupby_list]
File "/opt/odoo/odoo/addons/dms/models/dms_file.py", line 471, in _read_group_process_groupby
self.env["dms.directory"].with_context(prefetch_fields=False).search([])
File "/opt/odoo/odoo/odoo/models.py", line 1704, in search
res = self._search(args, offset=offset, limit=limit, order=order, count=count)
File "/opt/odoo/odoo/addons/dms/models/directory.py", line 346, in _search
args, offset, limit, order, False, access_rights_uid
File "/opt/odoo/odoo/odoo/models.py", line 4493, in _search
self._apply_ir_rules(query, 'read')
File "/opt/odoo/odoo/addons/dms/models/dms_security_mixin.py", line 142, in _apply_ir_rules
self._apply_access_groups(query, mode=mode)
File "/opt/odoo/odoo/addons/dms/models/dms_security_mixin.py", line 136, in _apply_access_groups
query.where_clause += [where_clause]
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
TypeError: can only concatenate tuple (not "list") to tuple

Preview for audio files

I'm missing a preview for audio files (WAV, MP3, OGG...), which browsers supports natively, but not when trying to preview files from these extensions in DMS. I think this can be a general issue in Odoo preview panel, but not sure right now.

[14.0]Can not upload file by drag & drop

Even if I select a directoy, When upload files by drag & drog,we will catch an error:
You must select a directory first
The same opteration was work correct in version 13

Access Groups failure system compromised | URGENT

I have been thoroughly testing out this module for a live use case scenario on an ODOO13 implementation.

What I have come to realize that its possible to gain access to other files in other access groups when the following scenario occurs:

-Create New DB Storage
-Create Root Directory Folder with Admin Only access permission group
-Create Sub Folders with Portal Users example: "Joels Files" "Marcs Files"
-Give Explicit User Access via Group permission to every individual folder. (Hence either user shouldn't be able to access the other files)
-Upload Files to individual directories
-Login to the portal for Marc, Marc will find his files, but in the breadcrumbs, he is able to access the root directory that contains other users folders and gain access to their files.

TESTED:
-Deleted all-access group permissions (with no access groups defined, files and dirs must be completely inaccessible):
DMS still accessible publicly via URLs such as http://localhost:8069/my/dms/directory/20

Something is seriously wrong with the session management and security groups access implementation, unfortunately, I don't have the time to fully investigate this issue.

QUICK EASY TEST:
-Install Demo
-Install DMS
-Log out
-Demo Links are accessible by the public:
http://localhost:8069/my/dms/directory/1
http://localhost:8069/my/dms/directory/11
http://localhost:8069/my/dms/directory/2

Error during module uninstallation

Module

DMS

Describe the bug

When I tried to Uninstall the module, the logs showed the error about the dms.directory and dms.file models. Now when I am trying to reinstall, it says:
ERROR dev_dms odoo.schema: Table 'dms_directory': unable to set NOT NULL on column 'name'
and
ERROR dev_dms odoo.schema: Table 'dms_file': unable to set NOT NULL on column 'directory_id'
Would you mind responding to me with the cause and its solution?

[PoC] ACL system modify

Actually, dms_directory and dms_file override default ACLs. Work fine but it's very difficult to understand, debug and it's a functionallity need to maintenance that odoo already does.

IMO it's a good idea to odoo adapt and remove dms_security_mixin.py

My propose:

Documents > Users have a rule like this: ['id', '=', 0]
The idea about this domain it's by default don't see nothing about dms_directory and dms_file
This "default rule" apply too portal user group.

Now, dms_acess_group is related to group_ids (res.groups) and explicit_user_ids (res.users), this change to Transient models similar to:

dms_access_group_res_group with this fields:

  • group_id (res.groups)

  • dms_directory_rule_id (ir.rule)

  • dms_file_rule_id (ir.rule)

and dms_access_group_res_user with similar fields

The idea about it is when create acess_group create ir_rule related to dms_directory model (dms_directory_rule_id) and dms_file model (dms_file_rule_id) and by default domain is empty (This rule apply to users, groups and perm_read, etc that configure it in the record).

When dms_directory is write and define dms_access_group_ids field, for each record, apply a function '_regenerate_ir_rules()' that exist in dms_access_group model and regenerate domain rule with exactly directories that allow access, for example:

  • dms_directory_rule_id: ['id', 'in', [1,3,4]]

  • dms_file_rule_id: ['directory_id', 'in', [1,3,4]]

This function (_regenerate_ir_rules) is trigger in write and unlink in dms_directory model.

IMO with this idea we can forget custom ACL because odoo work fine about this.

Additionally this change will solve "confused error" when apply access groups in a directory and user that change it (if not appear in users from all groups apply) don't write (or read) anymore.

Optional propose:

Using actual access_group, when aplly rule to directory, auto-create followers about all users related.
This option may seem more simplify, but need to re-write when user change groups, aplly auto-creation followers to ALL files, etc , maybe a lot of followers records to do it.

What do you think about it? @luismalta @pedrobaeza

@Tecnativa TT26004

[13.0] Error in portal when trying to access directory

Hello, Im in the community version of odoo, v13

When trying to access to the directory section, after installing the module and configure it with a group:

image

, the system gives me this extrange error:

image

This is the trace:

traceback (most recent call last):
File "/opt/odoo/odoo/odoo/tools/cache.py", line 85, in lookup
r = d[key]
File "/opt/odoo/odoo/odoo/tools/func.py", line 69, in wrapper
return func(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/tools/lru.py", line 44, in getitem
a = self.d[obj].me
KeyError: ('ir.model.access', <function IrModelAccess.check at 0x7f967936bea0>, 8, False, 'account.move', 'read', True, ('es_ES',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/addons/base/models/ir_http.py", line 229, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo/odoo/http.py", line 804, in dispatch
r = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 345, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 93, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 338, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 910, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 510, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/dms/controllers/portal.py", line 65, in portal_my_dms
values = self._prepare_portal_layout_values()
File "/opt/odoo/odoo/addons/dms/controllers/portal.py", line 33, in _prepare_portal_layout_values
values = super()._prepare_portal_layout_values()
File "/opt/odoo/odoo/addons/sale/controllers/portal.py", line 18, in _prepare_portal_layout_values
values = super(CustomerPortal, self)._prepare_portal_layout_values()
File "/opt/odoo/odoo/addons/hr_timesheet/controllers/portal.py", line 19, in _prepare_portal_layout_values
values = super(TimesheetCustomerPortal, self)._prepare_portal_layout_values()
File "/opt/odoo/odoo/addons/crnd_wsd/controllers/main.py", line 445, in _prepare_portal_layout_values
RequestCustomerPortal, self)._prepare_portal_layout_values()
File "/opt/odoo/odoo/addons/project/controllers/portal.py", line 19, in _prepare_portal_layout_values
values = super(CustomerPortal, self)._prepare_portal_layout_values()
File "/opt/odoo/odoo/addons/account/controllers/portal.py", line 15, in _prepare_portal_layout_values
('type', 'in', ('out_invoice', 'in_invoice', 'out_refund', 'in_refund', 'out_receipt', 'in_receipt')),
File "/opt/odoo/odoo/odoo/models.py", line 1595, in search_count
res = self.search(args, count=True)
File "/opt/odoo/odoo/odoo/models.py", line 1618, in search
res = self._search(args, offset=offset, limit=limit, order=order, count=count)
File "/opt/odoo/odoo/odoo/models.py", line 4373, in _search
model.check_access_rights('read')
File "/opt/odoo/odoo/odoo/models.py", line 3213, in check_access_rights
return self.env['ir.model.access'].check(self._name, operation, raise_exception)
File "", line 2, in check
File "/opt/odoo/odoo/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_model.py", line 1549, in check
raise AccessError(msg % msg_params)
odoo.exceptions.AccessError: ("Lo sentimos, no tiene permiso para acceder a documentos de tipo 'Asientos contables' (account.move). Esta operación está permitida para los grupos:\n\t- Expenses/Team Approver\n\t- Expenses/Team Approver\n\t- Invoicing/Billing\n\t- Invoicing/Billing Administrator\n\t- Sales/Administrator\n\t- Sales/User: Own Documents Only\n\t- User types/Portal - (Operación: read, Usuario: 8)", None)

Can you help me with this

Mobile VIew

Hi,

A client has asked me about the portrait mobile view, if there is anything we can do. The file listing doesn't look great with the address sidebar.

image

This kind of frontend stuff isn't my best, but if I get pointed the right way don't mind having a crack at some point. In the meantime they are work around with landscape view.

[13.0] Exception while changing name or file content

When I try to change the name or the file content of a file in DMS, it shows this exception:

The problem exist in runbot, not only on my local instance.

Odoo Server Error Traceback (most recent call last): File "/.repo_requirements/odoo/odoo/http.py", line 624, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/.repo_requirements/odoo/odoo/http.py", line 310, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/.repo_requirements/odoo/odoo/tools/pycompat.py", line 14, in reraise raise value File "/.repo_requirements/odoo/odoo/http.py", line 669, in dispatch result = self._call_function(**self.params) File "/.repo_requirements/odoo/odoo/http.py", line 350, in _call_function return checked_call(self.db, *args, **kwargs) File "/.repo_requirements/odoo/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/.repo_requirements/odoo/odoo/http.py", line 339, in checked_call result = self.endpoint(*a, **kw) File "/.repo_requirements/odoo/odoo/http.py", line 915, in __call__ return self.method(*args, **kw) File "/.repo_requirements/odoo/odoo/http.py", line 515, in response_wrap response = f(*args, **kw) File "/.repo_requirements/odoo/addons/web/controllers/main.py", line 1327, in call_kw return self._call_kw(model, method, args, kwargs) File "/.repo_requirements/odoo/addons/web/controllers/main.py", line 1319, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/.repo_requirements/odoo/odoo/api.py", line 387, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/.repo_requirements/odoo/odoo/api.py", line 374, in _call_kw_multi result = method(recs, *args, **kwargs) File "/.repo_requirements/odoo/odoo/models.py", line 6255, in onchange for name in nametree File "/.repo_requirements/odoo/odoo/models.py", line 6256, in <listcomp> if name not in done and snapshot0.has_changed(name) File "/.repo_requirements/odoo/odoo/models.py", line 6101, in has_changed return self[name] != record[name] File "/.repo_requirements/odoo/odoo/models.py", line 5731, in __getitem__ return self._fields[key].__get__(self, type(self)) File "/.repo_requirements/odoo/odoo/fields.py", line 1032, in __get__ self.compute_value(recs) File "/.repo_requirements/odoo/odoo/fields.py", line 1146, in compute_value records._compute_field_value(self) File "/.repo_requirements/odoo/odoo/models.py", line 4003, in _compute_field_value getattr(self, field.compute)() File "/home/odoo/build/OCA/dms/dms/models/dms_file.py", line 414, in _compute_mimetype binary = base64.b64decode(record.with_context({}).content or "") File "/usr/lib/python3.6/base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Incorrect padding

[14.0] Create Directory | TypeError: 'NewId' object is not iterable

On a fresh install, I am able to create Storage and Files, but whenever I try to create a Directory (either from the Storage page or the "Create" button on the Directory page), I get the following error:

`Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo/http.py", line 682, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/http.py", line 358, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/http.py", line 346, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/http.py", line 911, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo/http.py", line 530, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/web/controllers/main.py", line 1359, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/main.py", line 1351, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/models.py", line 6128, in onchange
value = record[name]
File "/opt/odoo/odoo/models.py", line 5617, in getitem
return self._fields[key].get(self, type(self))
File "/opt/odoo/odoo/fields.py", line 973, in get
self.compute_value(recs)
File "/opt/odoo/odoo/fields.py", line 1112, in compute_value
records._compute_field_value(self)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo/odoo/models.py", line 4020, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo/addons/dms/models/directory.py", line 416, in _compute_count_total_directories
count = self.search_count([("id", "child_of", record.id)])
File "/opt/odoo/odoo/models.py", line 1674, in search_count
res = self.search(args, count=True)
File "/opt/odoo/odoo/models.py", line 1697, in search
res = self._search(args, offset=offset, limit=limit, order=order, count=count)
File "/opt/odoo/odoo/models.py", line 4453, in _search
query = self._where_calc(args)
File "/opt/odoo/odoo/models.py", line 4209, in _where_calc
return expression.expression(domain, self).query
File "/opt/odoo/odoo/osv/expression.py", line 438, in init
self.parse()
File "/opt/odoo/odoo/osv/expression.py", line 651, in parse
ids2 = to_ids(right, model, leaf)
File "/opt/odoo/odoo/osv/expression.py", line 520, in to_ids
return list(value)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/http.py", line 314, in _handle_exception
raise exception.with_traceback(None) from new_cause
TypeError: 'NewId' object is not iterable`

I tried removing demo data, restarting the server, going in and out of dev mode and adjusting permissions but the error remains. For reference, I am using the latest version of dms and Odoo 14.1 CE.

Could something be misconfigured on my side? Please let me know if you need more info.

Thank you for your help!

Versioning

After the merge of #1, it is interesting to talk about versions. Original @muk-it had a custom module but I think it is on their private repos. I am interested on migrating/create this set of modules and any starting work is welcome. 😄

@keshrath @pedrobaeza

Installation on Odoo V14

I've installed DMS on Odoo V14 CE, yet the DMS tab doesn't show on the "contact module" for the portal user.
does it require any other module to be installed?

[12.0] Current user id overwritten by website user (id=4)

Hi there,
i've just installed DMS module and everything works properly at first. But I found something in the code that i cannot understand:

request.uid = request.website.user_id.id

request.uid = request.website.user_id.id

Why current user id (logged user) is overwrite by website user? I mean, whenever I try to access a directory, it throws me an error because user id (4) doesn't have permissions.
As a workaround, the solution is simple:

image

But I would like to know the purpose of that.
Thanks in advance.

[12.0] Drop target from Kanban to Attachment Storage folder doesn't inherit properly res_model and res_id

directory = directory_model.browse(self.env.context.get("active_id"))

Expected workflow:
When I drag and drop a file into a folder (with attachment storage) from the kanban view and attached to a record, I expect to create the attachment and be able to view from the record.

Results:
Record is created inside the folder but is not attached to the record.

Steps to reproduce this issue:

  1. Create an attachment storage.
  2. Create a folder linked to an existing employee (fastest removing the readonly property from the form record of res_id).
  3. Drag and drop a file to this folder from the main kanban view
  4. Check on the employee record the attachment (non exists)

install on odoo CE 14

i tried to install dms on a fresh odoo CE 14 edition.
in order to install dms i need to install web_drop_target. to install web_drop_target i need to install "document" which is no longer available?!

[https://github.com/OCA/web/issues/1973]

how can i get dms up and running on odoo 14 CE?

Backport to 12.0/11.0

As we talked on #1 It is interesting to backport the dms module to 12.0 following the OCA guidelines.

There are several steps to follow:

  • Check with @muk-it that there is no issue with that @keshrath
  • v12:
    • Create branch in GitHub
    • Backport webpanel (OCA/web#1629)
    • Migrate the module (#7 )
  • v11:
    • Create branch in GitHub
    • Backport webpanel
    • Migrate the module

installation error

I got this error in the installation
If you have any suggestions please.

Erreur:
Odoo Server Error

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create
    return self.create(values)
  File "<decorator-gen-31>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 475, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3775, in create
    fields[0].determine_inverse(batch_recs)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1120, in determine_inverse
    getattr(records, self.inverse)()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
    view.write(data)
  File "/usr/lib/python3/dist-packages/odoo/addons/website_theme_install/models/theme_models.py", line 226, in write
    res = super(IrUiView, other_views).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 51, in write
    return super(View, self).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 493, in write
    res = super(View, self).write(self._compute_defaults(vals))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3564, in write
    real_recs._validate_fields(set(vals) - set(inverse_fields))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields
    check(self)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 406, in _check_xml
    raise ValidationError(_('Invalid view %s definition in %s') % (view_name, view.arch_fs))
odoo.exceptions.ValidationError: ('Définition de vue dms_file.search non conforme dans dms/views/dms_file.xml', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 624, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 669, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 350, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 915, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1326, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1314, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 387, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 374, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-59>", line 2, in button_immediate_install
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
    return method(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 423, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 315, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 225, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 736, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 803, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 721, in parse
    exc_info[2]
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 13, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create
    return self.create(values)
  File "<decorator-gen-31>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 475, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3775, in create
    fields[0].determine_inverse(batch_recs)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1120, in determine_inverse
    getattr(records, self.inverse)()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
    view.write(data)
  File "/usr/lib/python3/dist-packages/odoo/addons/website_theme_install/models/theme_models.py", line 226, in write
    res = super(IrUiView, other_views).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 51, in write
    return super(View, self).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 493, in write
    res = super(View, self).write(self._compute_defaults(vals))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3564, in write
    real_recs._validate_fields(set(vals) - set(inverse_fields))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields
    check(self)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 406, in _check_xml
    raise ValidationError(_('Invalid view %s definition in %s') % (view_name, view.arch_fs))
odoo.tools.convert.ParseError: "Définition de vue dms_file.search non conforme dans dms/views/dms_file.xml
None" while parsing /mnt/extra-addons/dms/views/dms_file.xml:9, near
<odoo>
    <record id="search_dms_file" model="ir.ui.view">
        <field name="name">dms_file.search</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <search>
                <field name="name" filter_domain="[('name','ilike',self)]"/>
                <filter string="All Files" name="all" domain="['|',('active', '=',  False), ('active', '!=',  False)]"/>
                <filter string="My Files" name="filter_user" domain="[('create_uid', '=', uid)]"/>
                <separator/>
                <filter string="Archived Files" name="filter_active" domain="[('active', '=', False)]"/>
                <separator/>
                <filter string="Creation Date" name="filter_create" date="create_date"/>
                <filter string="Modification Date" name="filter_write" date="write_date"/>
                <group expand="0" string="Group By">
                    <filter name="group_color" string="Color" domain="[]" context="{'group_by':'color'}"/>
                    <filter name="group_category" string="Category" domain="[]" context="{'group_by':'category_id'}"/>
                    <separator/>
                    <filter name="group_storage" string="Storage" domain="[]" context="{'group_by':'storage_id'}"/>
                    <filter name="group_directory" string="Directories" domain="[]" context="{'group_by':'directory_id'}"/>
                </group>
                <searchpanel>
                    <field name="directory_id" icon="fa-folder" context="{'directory_short_name': True}" enable_counters="1"/>
                    <field name="category_id" icon="fa-users" enable_counters="1"/>
                </searchpanel>
            </search>
        </field>
    </record>
    <record id="view_dms_file_kanban" model="ir.ui.view">
        <field name="name">dms_file.kanban</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <kanban js_class="file_kanban" class="mk_file_kanban_view o_kanban_small_column align-content-start" banner_route="/dms/document_onboarding/file">
                <field name="id"/>
                <field name="tag_ids"/>
                <field name="name"/>
                <field name="color"/>
                <field name="active"/>
                <field name="mimetype"/>
                <field name="icon_url"/>
                <field name="create_uid"/>
                <field name="write_date"/>
                <field name="locked_by"/>
                <field name="is_locked"/>
                <field name="is_lock_editor"/>
                <field name="permission_write"/>
                <field name="permission_unlink"/>
                <field name="__last_update"/>
                <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="#{kanban_color(record.color.raw_value)} oe_kanban_global_click">
                            <div class="o_dropdown_kanban dropdown">
                                <a class="dropdown-toggle o-no-caret btn" href="#" role="button" data-toggle="dropdown" aria-label="Dropdown menu" title="Dropdown menu">
                                    <span class="fa fa-ellipsis-v"/>
                                </a>
                                <div class="dropdown-menu" role="menu">
                                    <div class="row">
                                        <div class="col-6 mk_file_kanban_operations">
                                            <h6 class="dropdown-header">
                                                Operations
                                            </h6>
                                            <a t-if="record.permission_write.raw_value and !record.is_locked.raw_value" role="menuitem" name="lock" type="object" class="dropdown-item">
                                                <i class="fa fa-lock"/>
                                                Lock
                                            </a>
                                            <a t-if="record.is_locked.raw_value  and record.is_lock_editor.raw_value" role="menuitem" name="unlock" type="object" class="dropdown-item">
                                                <i class="fa fa-unlock-alt"/>
                                                Unlock
                                            </a>
                                            <a t-if="record.permission_write.raw_value and record.active.raw_value" role="menuitem" name="toggle_active" type="object" class="dropdown-item">
                                                <i class="fa fa-archive"/>
                                                Archive
                                            </a>
                                            <a t-if="record.permission_write.raw_value and !record.active.raw_value" role="menuitem" name="toggle_active" type="object" class="dropdown-item">
                                                <i class="fa fa-archive"/>
                                                Unarchive
                                            </a>
                                            <a role="menuitem" class="dropdown-item" t-attf-href="/web/content?id=#{record.id.raw_value}&amp;field=content&amp;model=dms.file&amp;filename_field=name&amp;download=true">
                                                <i class="fa fa-download"/>
                                                Download
                                            </a>
                                        </div>
                                        <div class="col-6 border-left mk_file_kanban_actions">
                                            <h6 class="dropdown-header">
                                                Actions
                                            </h6>
                                            <a role="menuitem" type="open" class="dropdown-item">
                                                <i class="fa fa-external-link"/>
                                                Open
                                            </a>
                                            <a t-if="record.permission_write.raw_value" role="menuitem" type="edit" class="dropdown-item">
                                                <i class="fa fa-pencil-square-o"/>
                                                Edit
                                            </a>
                                            <a t-if="record.permission_unlink.raw_value" role="menuitem" type="delete" class="dropdown-item">
                                                <i class="fa fa-trash-o"/>
                                                Delete
                                            </a>
                                        </div>
                                    </div>
                                    <div t-if="record.permission_write.raw_value" class="row">
                                        <div role="menuitem" class="col-12">
                                            <ul class="oe_kanban_colorpicker" data-field="color"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="oe_kanban_content">
                                <div class="o_kanban_image">
                                    <div class="o_kanban_image_wrapper">
                                        <a class="o_kanban_dms_file_preview" t-att-data-id="widget.db_id">
                                            <img t-att-src="record.icon_url.raw_value" alt="Icon"/>
                                        </a>
                                    </div>
                                </div>
                                <div class="o_kanban_details">
                                    <div class="o_kanban_details_wrapper">
                                        <div class="o_kanban_record_title o_text_overflow">
                                            <a class="o_kanban_dms_file_preview fa fa-search" title="Search" t-att-data-id="widget.db_id"/>
                                            <field name="name"/>
                                        </div>
                                        <div class="o_kanban_record_body">
                                            <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
                                        </div>
                                        <div class="o_kanban_record_bottom">
                                            <div class="oe_kanban_bottom_left">
                                                <field name="write_date" widget="date"/>
                                            </div>
                                            <div class="oe_kanban_bottom_right">
                                                <span t-if="record.is_locked.raw_value" class="mk_file_kanban_lock">
                                                    <i t-attf-class="fa #{(record.is_locked.raw_value and !record.is_lock_editor.raw_value) ? 'fa-lock' : ''} #{((record.is_locked.raw_value and record.is_lock_editor.raw_value)) ? 'fa-unlock-alt' : ''}" t-att-title="record.locked_by.value"/>
                                                </span>
                                                <img t-att-src="kanban_image('res.users', 'image_128', record.create_uid.raw_value)" t-att-alt="record.create_uid.value" class="oe_kanban_avatar"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>
    <record id="view_dms_file_tree" model="ir.ui.view">
        <field name="name">dms_file.tree</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <tree string="Files" js_class="file_list" decoration-warning="not active" decoration-muted="(is_locked and not is_lock_editor)">
                <field name="active" invisible="1"/>
                <field name="is_locked" invisible="1"/>
                <field name="is_lock_editor" invisible="1"/>
                <field name="name"/>
                <field name="write_date"/>
                <field name="size"/>
                <field name="mimetype"/>
                <field name="path_names" widget="path_names" string="Path"/>
            </tree>
        </field>
    </record>
    <record id="view_dms_file_graph" model="ir.ui.view">
        <field name="name">dms_file.graph</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <graph type="pie">
                <field name="directory_id" type="row"/>
                <field name="size" type="measure"/>
            </graph>
        </field>
    </record>
    <record id="view_dms_file_pivot" model="ir.ui.view">
        <field name="name">dms_file.pivot</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <pivot display_quantity="true">
                <field name="storage_id" type="row"/>
                <field name="directory_id" type="row"/>
                <field name="size" type="measure"/>
            </pivot>
        </field>
    </record>
    <record id="view_dms_file_form" model="ir.ui.view">
        <field name="name">dms_file.form</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <form string="Files">
                <header>
                    <button class="oe_highlight" name="lock" type="object" string="Lock" attrs="{'invisible':['|',('is_locked', '!=', False),('permission_write', '=', False)]}"/>
                    <button class="oe_highlight" name="unlock" type="object" string="Unlock" attrs="{'invisible':['|',('is_locked', '=', False),('is_lock_editor', '=', False)]}"/>
                    <button name="%(portal.portal_share_action)d" string="Share" type="action" class="oe_highlight oe_read_only"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box"/>
                    <field name="image_1920" widget="image" class="oe_avatar" nolabel="1" options="{'image_preview': 'image_128'}"/>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name"/>
                            <field name="active" invisible="1"/>
                        </h1>
                        <h4>
                            <field name="path_json" widget="path_json" options="{'prefix': True, 'suffix': False}" attrs="{'invisible': ['|', ('name', '=', False), ('directory_id', '=', False)]}"/>
                        </h4>
                    </div>
                    <group name="content">
                        <group>
                            <field name="content" filename="name" widget="preview_binary"/>
                        </group>
                        <group>
                            <field name="extension"/>
                            <field name="mimetype"/>
                        </group>
                    </group>
                    <group name="settings">
                        <group>
                            <field name="directory_id" options="{'no_quick_create': True}"/>
                            <field name="storage_id" options="{'no_open': True}"/>
                        </group>
                        <group>
                            <field name="category_id" placeholder="Internal / Human Resource" options="{'no_open': True, 'no_create': True}"/>
                            <field name="tag_ids" widget="many2many_tags" placeholder="Tags..." options="{'color_field': 'color', 'no_create_edit': True}"/>
                        </group>
                    </group>
                    <group>
                        <field name="storage_id_save_type" invisible="True"/>
                        <field name="res_model" readonly="True" attrs="{'invisible': [('storage_id_save_type', '!=', 'attachment')]}"/>
                        <field name="res_id" readonly="True" attrs="{'invisible': [('storage_id_save_type', '!=', 'attachment')]}"/>
                        <field name="record_ref" attrs="{'invisible': [('storage_id_save_type', '!=', 'attachment')]}"/>
                    </group>
                    <notebook>
                        <page name="page_meta" string="Meta Information">
                            <group>
                                <group>
                                    <field name="create_date" readonly="1"/>
                                    <field name="create_uid" readonly="1"/>
                                </group>
                                <group>
                                    <field name="write_date" readonly="1"/>
                                    <field name="write_uid" readonly="1"/>
                                </group>
                            </group>
                        </page>
                        <page name="page_access" string="Access Information">
                            <group>
                                <group>
                                    <field name="permission_write" readonly="1"/>
                                    <field name="permission_unlink" readonly="1"/>
                                </group>
                                <group>
                                    <field name="is_lock_editor" invisible="1"/>
                                    <field name="is_locked" invisible="1"/>
                                    <field name="locked_by"/>
                                </group>
                            </group>
                        </page>
                        <page name="page_technical" string="Technical Information" invisible="1" groups="dms.group_dms_manager,base.group_no_one">
                            <group name="technical">
                                <group name="technical_left">
                                </group>
                                <group name="technical_right">
                                </group>
                            </group>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids"/>
                    <field name="activity_ids"/>
                    <field name="message_ids"/>
                </div>
            </form>
        </field>
    </record>
    <record id="view_dms_file_manager_form" model="ir.ui.view">
        <field name="name">dms_file.form</field>
        <field name="model">dms.file</field>
        <field name="inherit_id" ref="view_dms_file_form"/>
        <field name="groups_id" eval="[(6, 0, [ref('dms.group_dms_manager')])]"/>
        <field name="arch" type="xml">
            <field name="storage_id" position="attributes">
                <attribute name="options">{}</attribute>
            </field>
        </field>
    </record>
    <record id="action_dms_file" model="ir.actions.act_window">
        <field name="name">Files</field>
        <field name="res_model">dms.file</field>
        <field name="view_mode">kanban,tree,graph,pivot,form</field>
        <field name="domain">[("is_hidden", "=", False)]</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Add a new File.
            </p>
            <p>
                Files are used to save content directly in Odoo.
            </p>
        </field>
    </record>
    <menuitem id="menu_dms_file" name="Files" sequence="20" parent="main_menu_dms" action="action_dms_file"/>
    <record id="search_dms_file_migration" model="ir.ui.view">
        <field name="name">dms_file.search</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <search>
                <field name="name" filter_domain="[('name','ilike',self)]"/>
                <group expand="0" string="Group By">
                    <filter name="group_storage" string="Storage" domain="[]" context="{'group_by':'storage_id'}"/>
                </group>
                <searchpanel>
                    <field name="directory_id" icon="fa-folder" enable_counters="1"/>
                    <field name="category_id" icon="fa-users" enable_counters="1"/>
                </searchpanel>
            </search>
        </field>
    </record>
    <record id="view_dms_file_migration_tree" model="ir.ui.view">
        <field name="name">dms_file.tree</field>
        <field name="model">dms.file</field>
        <field name="arch" type="xml">
            <tree string="Files" decoration-muted="(is_locked and not is_lock_editor)" create="0" delete="0">
                <field name="is_locked" invisible="1"/>
                <field name="is_lock_editor" invisible="1"/>
                <field name="name"/>
                <field name="write_date"/>
                <field name="content"/>
                <field name="mimetype"/>
                <field name="storage_id"/>
                <field name="migration"/>
            </tree>
        </field>
    </record>
    <record id="action_dms_file_migration" model="ir.actions.act_window">
        <field name="name">Files</field>
        <field name="res_model">dms.file</field>
        <field name="view_mode">tree</field>
        <field name="search_view_id" ref="search_dms_file_migration"/>
        <field name="domain">[('require_migration', '=', True), '|',('active', '=', False), ('active', '!=', False)]
        </field>
        <field name="context">{'search_default_group_storage': 1}</field>
        <field name="view_ids" eval="[(5, 0, 0), (0, 0, {'view_mode': 'tree', 'view_id': ref('view_dms_file_migration_tree')})]"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Add a new File.
            </p>
            <p>
                Files are used to save content directly in Odoo.
            </p>
        </field>
    </record>
    <menuitem id="menu_dms_file_migration" name="Migration" parent="cat_menu_dms_config_system" action="action_dms_file_migration" sequence="8"/>
    <record id="view_dms_file_new_form" model="ir.ui.view">
        <field name="name">dms_file.form</field>
        <field name="model">dms.file</field>
        <field name="inherit_id" ref="view_dms_file_form"/>
        <field name="mode">primary</field>
        <field name="arch" type="xml">
            <xpath expr="//header" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
            <xpath expr="//sheet//div[hasclass('oe_button_box')]" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
            <form position="inside">
                <footer>
                    <button class="btn btn-primary" type="object" string="Create" name="action_save_onboarding_file_step"/>
                    <button special="cancel" string="Cancel"/>
                </footer>
            </form>
        </field>
    </record>
    <record id="action_dms_file_new" model="ir.actions.act_window">
        <field name="name">New Root Directory</field>
        <field name="res_model">dms.file</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
        <field name="view_id" ref="view_dms_file_new_form"/>
    </record>
</odoo>

[12.0] Permission problem

Hi all,

since permission changes (c147000) I have problems to get DMS working with dms_field and res.partner model in odoo 12.0:

What works:
I can create a new storage (filestorage) without linked model. When I create a root-directory for that storage I need to assign an access group during create. If I dont do this, I get an error. With access group assigned, the directory will be created and I can upload files.

Permission problem:
But when I use dms_field and link res.partner model to the storage I cannot assign an access group -> in partner view I try to attach the storage (view from demo). I can select my storage in dropdown, but when I select it I get the following error:

"The requested operation cannot be completed due to security restrictions. Please contact your system administrator."

I think this is because there is no access group assigned to the directory to be created, but in the view there is no possibility to select one. Any chance to set a standard access group for the whole storage or other ideas how to solve this?

Thanks!
Steve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.