OCA / storage

GNU Affero General Public License v3.0
70 stars 159 forks source link

[16.0] [IMP] fs_attachment: store attachments linked to different model/fields to different FS storages #269

Closed marielejeune closed 1 year ago

marielejeune commented 1 year ago

Supersedes https://github.com/OCA/storage/pull/260 (This PR is part of the RFC https://github.com/OCA/storage/pull/252 and depends on it.)

One may want to store attachments linked to different Odoo models/fields to different FS storages. This is now possible: on the fs.storage one just has to configure for which models / fields it will be the default storage. It is also possible to configure it in a server environment file, by giving a comma-separated list of models/fields XML ids.

lmignon commented 1 year ago

/ocabot merge nobump

OCA-git-bot commented 1 year ago

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

OCA-git-bot commented 1 year ago

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

xavierpiernas commented 1 year ago

I've encountered an issue with fs_attachment. After installation, I'm unable to create new attachments as it triggers the "_compute_internal_url" function, which crashes at the following line:

filename, extension = os.path.splitext(rec.name)

This occurs because the attachment initially lacks a name.