-
-
Notifications
You must be signed in to change notification settings - Fork 200
[18.0][MIG] fs_file #445
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
[18.0][MIG] fs_file #445
Conversation
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/
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/
6d11c04 to
086a16c
Compare
|
/ocabot migration fs_file |
There was a problem hiding this 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)
|
/ocabot merge nobump |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at 885efe2. Thanks a lot for contributing to OCA. ❤️ |
No description provided.