Skip to content

Conversation

@rousseldenis
Copy link
Contributor

No description provided.

lmignon and others added 30 commits February 19, 2025 16:55
Uses the FilUploader component to manage the file selection and save the file content at same time as the model. Prior to this change, the content was saved as soon as it was selected which is not possible on new records
* Defines extension hooks to use to specify the object type to use as field value and the value to pass when updating the attachment.
* Fixes onchange
Store your image into an external filesystem
The *url_path*, *url* and *internal_url* properties on the *FSFileValue*
object return *None* if the information is not available (instead of *False*).
To avoid 'Duplicate explicit target name' error in the rst files where 2 links reference the same url, we must use the  double underscores __ to make the reference anonymous
The mimetype property of FSFileValue is computed as follow:

* If an attachment is set, the mimetype is taken from the attachment.
* If no attachment is set, the mimetype is guessed from the name of the file.
* If the mimetype cannot be guessed from the name, the mimetype is guessed from the content of the file.
When a new value is assigned to a stored FSFile field, the cache must be invalidated and not contain the given value. This is required since when you access a stored FSFile field, teh FSFileValue returned must be linked to the attachment used to store the file in the storage
Currently translated at 66.6% (2 of 3 strings)

Translation: storage-16.0/storage-16.0-fs_file
Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_file/it/
Currently translated at 100.0% (3 of 3 strings)

Translation: storage-16.0/storage-16.0-fs_file
Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_file/it/
Currently translated at 100.0% (3 of 3 strings)

Translation: storage-16.0/storage-16.0-fs_file
Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_file/es/
lmignon and others added 10 commits February 19, 2025 16:55
Before this change the creation of empty file was not supported. The issue was mainly due to the fact that at create of a FSFileValue instance with a name but without content, the name was no preserved. As result, the insert of the attachement into the DB failed since the name is a required field. If a FSFileValue instance is now created without content but with a name, the name is now preserved on an empty buffer.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: storage-17.0/storage-17.0-fs_file
Translate-URL: https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_file/
Currently translated at 100.0% (3 of 3 strings)

Translation: storage-17.0/storage-17.0-fs_file
Translate-URL: https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_file/it/
@rousseldenis
Copy link
Contributor Author

@lmignon

@lmignon
Copy link
Contributor

lmignon commented Feb 24, 2025

/ocabot migration fs_file

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 24, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 24, 2025
26 tasks
Copy link
Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (Code review + diff with 16.0 and functional via #449)

@lmignon
Copy link
Contributor

lmignon commented Mar 27, 2025

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-445-by-lmignon-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 134fb3d into OCA:18.0 Mar 27, 2025
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@lmignon lmignon deleted the 18.0-mig-fs-file-dro branch March 27, 2025 13:43
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.

9 participants