Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] fs_attachment: Migration to 17.0 #344

Merged
merged 48 commits into from
Mar 24, 2024

Conversation

nguyenminhchien
Copy link

@nguyenminhchien nguyenminhchien commented Feb 28, 2024

Ref: BSRD-747

lmignon and others added 23 commits March 11, 2024 16:11
Avoid recompute of new columns when installed on an existing database
Allows to provide configuration parameters through server environement files.
Remove code used to try to read file from the root filesystem and write into the specialized filesystem. This code was used to try to provide a way to manage staging environments by reusing the same filesystem storage but with a different directory_path depending of the environement. A simpler method is to configure use a different filesystem storage by environement. If a production database is restored in pre production env, you can declare a new filesystem storage with a different code to store the attachements by default and configure the filesystem storage from the production with information allowing to read documents stored in it but not to modify or delete existing documents. This make the implementation far more simple.
To create a new cursor, just ask to the current registry.... Loading a registry is very time consuming and could lead to deadlocks...
Fix image streaming
Fix image streaming with resize
Fix content size whithout x-send-file
This code was initially used to magically know if we need to obfusc or not the filename into the database. Since this option is now explicit, we can safely remove-it. Moreover, without this code it's now possible to migrate old storage_file contents to the new fs_* addons
Add history for commit included from OCA#285 and the author to the contributors list
mymage and others added 18 commits March 11, 2024 16:11
When manipulating the file system api through a local variable named *fs*,
we observed some strange behavior when it was wrongly redefined in an
enclosing scope as in the following example: *with fs.open(...) as fs*.
This commit fixes this issue by renaming the local variable and therefore
avoiding the name clash.
Currently translated at 36.9% (24 of 65 strings)

Translation: storage-16.0/storage-16.0-fs_attachment
Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/it/
Before this change, when the fs_url was computed the computed value was always
reassigned to the fs_url attribute even if the value was the same. In a lot of
cases the value was the same and the reassignment was not necessary. Unfortunately
this reassignment has as side effect to mark the record as dirty and generate a
SQL update statement at the end of the transaction.
Currently translated at 100.0% (65 of 65 strings)

Translation: storage-16.0/storage-16.0-fs_attachment
Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/it/
fs.storage is protected as it contains credentials.
It must be accessed sudo when needed for regular users
manipulating ir.attachments.
Let "image.png" be an image.
Thumbnails might be created with a path such as "38/5b/image-128.png".
Before, the path was forgotten when updating the attachment,
so accessing the file would crash, making the record inaccessible.
Currently translated at 100.0% (65 of 65 strings)

Translation: storage-16.0/storage-16.0-fs_attachment
Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/it/
If say click-odoo-update fails partway, the columns are already created
and the following tentative update fails because the columns exist.
…en the new mimetype doesn't match the old one
@lmignon
Copy link
Sponsor Contributor

lmignon commented Mar 24, 2024

/ocabot migration fs_attachment

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Mar 24, 2024
@lmignon
Copy link
Sponsor Contributor

lmignon commented Mar 24, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-344-by-lmignon-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e4cd4e7 into OCA:17.0 Mar 24, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 22ab4c9. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet