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

[18.0][MIG] fs_file #445

Open
wants to merge 40 commits into
base: 18.0
Choose a base branch
from
Open

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
21 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)

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

Successfully merging this pull request may close these issues.

9 participants