Repository navigation
[20.0][MIG] dms: Migration to 20.0 - #532
Open
CarlosRoca13 wants to merge 100 commits into
Open
CarlosRoca13 wants to merge 100 commits into
CarlosRoca13 wants to merge 100 commits into
Conversation
Member
|
/ocabot migration dms |
1 task
(cherry picked from commit 91e40e2)
(cherry picked from commit 99f2a9a)
…field - Remove path_names field - Remove FieldPathNames (related to path_names) (cherry picked from commit d1dac0d)
(cherry picked from commit 34800b4)
(cherry picked from commit a4212a1)
… All text to Root) + Change to searchpanel directory_id (in files) or parent_id (in directories) to filter equal and not child_of (cherry picked from commit ddef636)
(cherry picked from commit f87efa4)
We need to overwrite function from directories because odoo only return records with childs (very weird for user perspective). All records are returned now. (cherry picked from commit eea9b6b)
(cherry picked from commit 8f98ab9)
…om attachment (cherry picked from commit d2c6b8c)
(cherry picked from commit 4a0e5ea)
…search panel directory). TT41585 (cherry picked from commit e029027)
…s to. TT41585 (cherry picked from commit e7a0878)
…ich you have access) in the portal view. TT41585 (cherry picked from commit 8282362)
…ord field (cherry picked from commit 7dce5e4)
TT41512 (cherry picked from commit 3fbb602)
The method _compute_image_1920 of dms_file checks if the file is of
mimetype image and tries to use it as a thumbnail.
However, there are several types of image files that Odoo/PIL
cannot work with, leading to the following error:
```
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/tools/image.py", line 404, in base64_to_image
return Image.open(io.BytesIO(base64.b64decode(base64_source)))
File "/usr/local/lib/python3.6/site-packages/PIL/Image.py", line 2687, in open
% (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x7f0a6ecb1780>
```
and also further down
```
odoo.exceptions.UserError: ('This file could not be decoded as an image file. Please try with a different file.', '')
```
Examples of such files are CAD files (mimetype: image/vnd.dwg)
For a list of all mimetypes starting with "image/" see:
https://www.iana.org/assignments/media-types/media-types.xhtml#image
(cherry picked from commit fdfe5d9)
Change in the permissions for DMS Access Groups: - Not every user can create new access groups, but only dms_users. - DMS managers (not admin users) can manage every access group - Add tests After this change: - the base user has read only access - the group_dms_user can create, and can write and unlink their own groups - the group_dms_manager can do everything on every group. (cherry picked from commit a659369)
(cherry picked from commit f789fbf)
… the files. TT43563 (cherry picked from commit 3ebd09e)
Currently translated at 94.3% (319 of 338 strings) Translation: dms-15.0/dms-15.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms/es/ (cherry picked from commit 010edfd)
(cherry picked from commit 7da2368)
Translated using Weblate (Portuguese (Brazil)) Currently translated at 70.0% (238 of 340 strings) Translation: dms-16.0/dms-16.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-dms/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 75.5% (257 of 340 strings) Translation: dms-16.0/dms-16.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-dms/pt_BR/ (cherry picked from commit f5971bd)
(cherry picked from commit 773a05d)
Currently translated at 100.0% (354 of 354 strings) Translation: dms-18.0/dms-18.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms/it/ (cherry picked from commit b82c5ad)
Currently translated at 100.0% (359 of 359 strings) Translation: dms-18.0/dms-18.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms/it/ (cherry picked from commit 547eaaf)
(cherry picked from commit 34b922d)
… is applied correctly. Before these changes, the domain was never applied to search by the parent, so all subfolders were being displayed instead of only the direct children of the selected one. After making the changes, only a single level of folders is shown, without displaying all descendant folders. (cherry picked from commit 12c54a9)
Currently translated at 89.6% (322 of 359 strings) Translation: dms-18.0/dms-18.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms/es/ (cherry picked from commit 687ec9c)
The _check_access_dms_record method uses self.search(domain) to verify write permissions. However, search() applies active_test=True by default, which excludes archived records (active=False). This means when a user tries to unarchive a file via toggle_active(), the write permission check cannot find the archived record in the search results, causing an AccessError even when the user has full write permissions through DMS access groups. Fix: add active_test=False context to include archived records in the permission check search. (cherry picked from commit 86cc746)
(cherry picked from commit e5f4b46)
Currently translated at 99.7% (358 of 359 strings) Translation: dms-18.0/dms-18.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms/es/ (cherry picked from commit 69f82dc)
Currently translated at 100.0% (358 of 358 strings) Translation: dms-18.0/dms-18.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms/it/ (cherry picked from commit b5c4821)
When an incoming email is processed for a dms.directory alias configured
with "Unpack Emails as: Subdirectory" (alias_process='directory'),
message_new() builds the new subdirectory name from the email subject by
calling ir.http._slug() on a plain string. _slug() expects a record or a
(id, name) tuple, so it raises:
ValueError: too many values to unpack (expected 2)
and the incoming email cannot be ingested. The intent is simply to
slugify the subject string, which is what ir.http._slugify() does.
Use it instead.
Previous implementation was failing to convert strings to base64, which is the case when we receive plain HTML encoded as base64; as shown in mail02.eml. This in turn lead to inconsistencies when saving/reading these contents afterwards, as the rest of the code always assumes dms.file::content contains base64 data. This was falling through cracks because although the resulting data is invalid base64, the b64decode impl in python 3.12/3.13 is lax enough it would ignore failures in this case because our test string is "base64-ish" enough. However, when running Odoo on Debian with the patch https://sources.debian.org/patches/python3.13/3.13.5-2+deb13u3/CVE-2026-3446.patch/ applied, this test on mail02.eml produced errors in dms.file::_inverse_content when trying to b64decode: > <class 'binascii.Error'> Invalid base64-encoded string: number of data characters (429) cannot be 1 more than a multiple of 4
dms.file.check_access_token compared the directory walker against self.directory_id instead of against the directory owning the token, so both the loop test and the "fix last level" test were self-comparisons that are always true. The branch collapsed to `return True` whenever any directory carried the supplied token, granting read access to every dms.file in the database regardless of directory or group inheritance. Compare against item.id, matching the correct implementation in dms.directory.check_access_token, and sudo the walk so ancestors the caller cannot read are still traversable. _get_files in the portal controller relied on the always-true behaviour: it called check_access_token on an empty dms.file recordset, where False == False happened to authorise the shared listing. Validate the token against the directory being browsed instead, mirroring the pattern already used by _get_directories. Adds regression tests covering unrelated trees, root-level files, descendant directories and a file's own token. Assisted-by: Claude Opus 5 [FIX] dms: bound the share-token ancestor walk The file-side walk previously returned on its first iteration because of the self-comparison bug, so it never actually traversed. Now that it does, a parent cycle would spin forever in a request reachable without authentication. _check_directory_recursion rejects cycles created through the ORM, so this only bites on corrupted data or direct SQL, but an unbounded loop on an anonymous endpoint is not worth leaving open. Track visited ids in both dms.file and dms.directory rather than imposing an arbitrary depth limit, so legitimate deep trees are unaffected. Assisted-by: Claude Opus 5 Co-authored-by: sajjad <sajjad@millow.co>
Assisted-by: Claude Fable 5
Assisted-by: Claude Fable 5
OR([[], ('name', 'ilike', search) leaf]) contains the empty domain, which
normalizes to TRUE — the absorbing element of OR — so the search term was
discarded: 18.0 expression.combine returns its zero, 19.0 Domain.OR
optimizes to [(1, '=', 1)]. Verified live in both forms; a search for a
non-existent term returned every directory.
The empty seed came from the core portal multi-field accumulator idiom
(38d8463, 2020), where core appends per-field domains to a plain list and
ORs once at the end; inlined to the current shape by the 17.0 migration.
Assisted-by: Claude Fable 5
Use Case Example: - Create an archived user (an employee’s user account that will be activated in the future) - Create a group that explicitly includes the user created earlier (this is done indirectly using `hr_dms_field`) - The `users` field does not contain this user TT64366
…e drag-and-drop process Fixes OCA#515
Use node content instead of a t-value expression so the portal description is correctly extracted for translation.
Currently translated at 100.0% (341 of 341 strings) Translation: dms-19.0/dms-19.0-dms Translate-URL: https://translation.odoo-community.org/projects/dms-19-0/dms-19-0-dms/it/
CarlosRoca13
force-pushed
the
20.0-MIG-dms
branch
from
October 29, 2026 07:52
ad19209 to
691d448
Compare
|
The following commit authors need to sign the Contributor License Agreement: |
CarlosRoca13
force-pushed
the
20.0-MIG-dms
branch
from
October 29, 2026 08:16
691d448 to
1b3012e
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cc @Tecnativa TT65283
ping @victoralmau @juancarlosonate-tecnativa