Maintainers
+Maintainers
This module is maintained by the OCA.
diff --git a/fs_attachment_s3/tests/test_fs_attachment_s3.py b/fs_attachment_s3/tests/test_fs_attachment_s3.py
index faf4602a9d..67488c7fff 100644
--- a/fs_attachment_s3/tests/test_fs_attachment_s3.py
+++ b/fs_attachment_s3/tests/test_fs_attachment_s3.py
@@ -33,3 +33,37 @@ def test_get_x_sendfile_path(self):
"/fs_x_sendfile/http/minio.minio/test-bucket/dir/sub/fake_s3_file.txt",
f"The X-Accel-Redirect path should match the expected format. ({url})",
)
+
+ def test_get_x_sendfile_path_s3_signed_with_prefix(self):
+ """Test the path generation when the directory path has a prefix."""
+ self.s3_backend.write(
+ {
+ "s3_uses_signed_url_for_x_sendfile": True,
+ "s3_signed_url_expiration": 60,
+ "directory_path": "test-bucket/test-prefix",
+ }
+ )
+
+ url = self.fake_attachment_s3._get_x_sendfile_path()
+ self.assertTrue(
+ url.startswith(
+ "/fs_x_sendfile/http/minio.minio/"
+ "test-bucket/test-prefix/dir/sub/fake_s3_file.txt?"
+ ),
+ f"The URL should include the prefix. ({url})",
+ )
+
+ def test_get_x_sendfile_path_with_prefix(self):
+ """Test the unsigned path generation with a prefix."""
+ self.s3_backend.write(
+ {
+ "s3_uses_signed_url_for_x_sendfile": False,
+ "directory_path": "test-bucket/test-prefix",
+ }
+ )
+ url = self.fake_attachment_s3._get_x_sendfile_path()
+ self.assertEqual(
+ url,
+ "/fs_x_sendfile/http/minio.minio/test-bucket/test-prefix/dir/sub/fake_s3_file.txt",
+ f"The URL should include the prefix. ({url})",
+ )
diff --git a/fs_image_thumbnail/README.rst b/fs_image_thumbnail/README.rst
new file mode 100644
index 0000000000..71e5a13bc4
--- /dev/null
+++ b/fs_image_thumbnail/README.rst
@@ -0,0 +1,203 @@
+.. image:: https://odoo-community.org/readme-banner-image
+ :target: https://odoo-community.org/get-involved?utm_source=readme
+ :alt: Odoo Community Association
+
+==================
+Fs Image Thumbnail
+==================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:d3bdee27ce44f4ed9a1dbe60d1af31f43cfa73f267baa110fd5e47e246218171
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Alpha
+.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github
+ :target: https://github.com/OCA/storage/tree/18.0/fs_image_thumbnail
+ :alt: OCA/storage
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/storage-18-0/storage-18-0-fs_image_thumbnail
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/storage&target_branch=18.0
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module extends the **fs_image** addon to support the creation and
+the storage of thumbnails for images. This module is a **technical
+module** and is not meant to be installed by end-users. It only provides
+a mixin to be used by other modules and a model to store the thumbnails.
+
+.. IMPORTANT::
+ This is an alpha version, the data model and design can change at any time without warning.
+ Only for development or testing purpose, do not use in production.
+ `More details on development status Fs Image Thumbnail
+ + +This module extends the fs_image addon to support the creation and +the storage of thumbnails for images. This module is a technical +module and is not meant to be installed by end-users. It only provides +a mixin to be used by other modules and a model to store the thumbnails.
+Important
+This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status
+Table of contents
+Use Cases / Context
+In some specific cases you may need to generate and store thumbnails of +images in Odoo. This is the case for example when you want to provide +image in specific sizes for a website or a mobile application.
+This module provides a generic way to generate thumbnails of images and +store them in a specific filesystem storage. Indeed, you could need to +store the thumbnails in a different storage than the original image (eg: +store the thumbnails in a CDN) to make sure the thumbnails are served +quickly when requested by an external application and to avoid to expose +the original image storage.
+This module uses the +fs_image +module to store the thumbnails in a filesystem storage.
+The +shopinvader_product_image +addon uses this module to generate and store the thumbnails of the +images of the products and categories to be accessible by the website.
+Usage
+This addon provides a convenient way to get and create if not exists +image thumbnails. All the logic is implemented by the abstract model +fs.image.thumbnail.mixin. The main method is get_or_create_thumbnails +which accepts a FSImageValue instance, a list of thumbnail sizes and a +base name.
+When the method is called, it will check if the thumbnail exists for the +given sizes and base name. If not, it will create it.
+The fs.thumbnail model provided by this addon is a concrete +implementation of the abstract model fs.image.thumbnail.mixin. The +motivation to implement all the logic in an abstract model is to allow +developers to create their own thumbnail models. This could be useful if +you want to store the thumbnails in a different storage since you can +specify the storage to use by model on the fs.storage form view.
+Creating / retrieving thumbnails is as simple as:
++from odoo.addons.fs_image.fields import FSImageValue + +# create an attachment with a image file +attachment = self.env['ir.attachment'].create({ + 'name': 'test', + 'datas': base64.b64encode(open('test.png', 'rb').read()), + 'datas_fname': 'test.png', +}) + +# create a FSImageValue instance for the attachment +image_value = FSImageValue(attachment) + +# get or create the thumbnails +thumbnails = self.env['fs.thumbnail'].get_or_create_thumbnails(image_value, sizes=[(800,600), (400, 200)], base_name='my base name') ++
If you’ve a model with a FSImage field, the call to +get_or_create_thumbnails is even simpler:
++from odoo import models +from odoo.addons.fs_image.fields import FSImage + +class MyModel(models.Model): + _name = 'my.model' + + image = FSImage('Image') + +my_record = cls.env['my.model'].create({ + 'image': open('test.png', 'rb'), +}) + +# get or create the thumbnails +thumbnails = record.image.get_or_create_thumbnails(my_record.image, + sizes=[(800,600), (400, 200)], base_name='my base name') ++
Changelog
+16.0.1.0.1 (2023-10-04)
+Bugfixes
+-
+
- The call to the method get_or_create_thumbnails on the +fs.image.thumbnail.mixin class returns now an ordered dictionary +where the key is the original image and the value is a recordset of +thumbnail images. The order of the dict is the order of the images +passed to the method. This ensures that when you process the result of +the method you can be sure that the order of the images is the same as +the order of the images passed to the method. +(#282) +
Bug Tracker
+Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.
+Do not contact contributors directly about support or help with technical issues.
+Credits
+Authors
+-
+
- ACSONE SA/NV +
Contributors
+-
+
- Laurent Mignon <laurent.mignon@acsone.eu> (https://acsone.eu) +
- Do Anh Duy <duyda@trobz.com> (https://trobz.com) +
Other credits
+The development of this module has been financially supported by:
+-
+
- Alcyon Belux +
Maintainers
+This module is maintained by the OCA.
+ +
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.
+Current maintainer:
+ +This module is part of the OCA/storage project on GitHub.
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+-
+
Microsoft account for Drive
!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:45da0ca6403c800cbb29675b06c2f9065eed5626758a2c4d80391d732c38e8d7 +!! source digest: sha256:a62ab45f11d8374004463a4dcc823381cdd67e5e72ea05c2a43dd7c4bcef3d2a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->This addon allows the user to link their Microsoft Drive account to @@ -381,53 +381,94 @@
Microsoft account for Drive
Table of contents
Configuration
-In order to use the Microsoft Drive Account module, you need to set -following configuration parameters in your Odoo instance:
+In order to use the Microsoft Drive Account module, you need to follow +this process for link Odoo and Microsoft:
+PART 1 : Create an Azure Application
+To allow Odoo to access Microsoft OneDrive or SharePoint through the +Microsoft Graph API, you must create an application in Azure Active +Directory.
+Step 1 – Open the Azure portal and go to Azure Active Directory, then +“App registrations”, and click “New registration”.
+Step 2 – Register the application. Set a name “Odoo storage +integration”. Select the third option “Accounts in any organizational +directory (Any Microsoft Entra ID tenant - Multitenant) and personal +Microsoft accounts (e.g. Skype, Xbox)” Add a Redirect URI of type “Web”. +{URL of your Odoo instance}/microsoft_account/authentication. Once the +application is created, note the Application (client) ID and the +Directory (tenant) ID.
+
Step 3 – Generate a client secret. Go to Certificates & secrets, create +a new client secret (Description : Odoo storage secret / Expires : +24month), and copy its value. You will not be able to see it again.
+
Step 4 – Configure API permissions. Open API permissions, add Microsoft +Graph “Application permissions”, and include Files.ReadWrite.All, and +Sites.ReadWrite.All. Add also “Delegated permission” for include +offline_access, openid.
+IMPORTANT : Grant admin consent so the application can use these +permissions.
+
PART 2 : Set Odoo System Parameters
+You need your tenant_url, you can find it in your Azure portal, open +Home > Dashboard. Look at the URL, it’s usually ends with +onmicrosoft.com.
+
In Odoo, open Settings > Technical > System Parameters.
+Required parameters:
-
-
- microsoft_account.auth_endpoint: The URL of the Microsoft -authentication endpoint. This is usually -https://login.microsoftonline.com/{your -endpoint id}/oauth2/v2.0/authorize. -
- microsoft_account.token_endpoint: The URL of the Microsoft token -endpoint. This is usually -https://login.microsoftonline.com/{your -endpoint id}/oauth2/v2.0/token. -
- microsoft_drive_client_id: The client ID of your Microsoft -application. This is a unique identifier for your application that you -can obtain from the Azure portal. -
- microsoft_drive_client_secret: The client secret of your Microsoft -application. This is a secret key that you can obtain from the Azure -portal. It is used to authenticate your application with the Microsoft -Graph API. +
- microsoft_account.auth_endpoint : This is the Microsoft OAuth2 +authorization URL. It usually has the form: +https://login.microsoftonline.com/{tenant_url}/oauth2/v2.0/authorize +
- microsoft_account.token_endpoint : This is the token endpoint URL, +usually: +https://login.microsoftonline.com/{tenant_url}/oauth2/v2.0/token +
- microsoft_drive_client_id : The Client ID of the Azure application. +
- microsoft_drive_client_secret : The Client Secret value generated in +Azure.
Optionally, you can set the following parameters:
+Optional parameter :
-
-
- microsoft_drive_client_scope: The scope of the Microsoft application.
-By default the following scopes are used
-
-
- offline_access -
- openid -
- Files.ReadWrite.All -
- Sites.ReadWrite.All -
+ - microsoft_drive_client_scope : Defines the permissions requested by +Odoo. If not defined, Odoo uses the default scopes: offline_access, +openid, Files.ReadWrite.All, Sites.ReadWrite.All.
PART 3 : Test the Configuration
+Step 1 – In Odoo, go to your odoo profile and select “Account +Security”,then click on the “grey cloud icon”.
+Step 2 – You will be redirected to the Microsoft login page. Sign in and +accept the requested permissions. You will then be redirected back to +Odoo.
+Step 3 – After authorization, Odoo should display a “blue cloud icon”. +The connection is now established.
+
Usage
+Usage
On the user preference page, the user can link their Microsoft Drive account to Odoo by cliking on the Drive button. This will redirect the user to the Microsoft authentication page, where they can log in and @@ -436,7 +477,7 @@
Usage
their Drive account will be linked.Bug Tracker
+Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -444,28 +485,28 @@
Bug Tracker
Do not contact contributors directly about support or help with technical issues.
Credits
+Credits
Other credits
+Other credits
The development of this module has been financially supported by:
- ACSONE SA/NV
Maintainers
+Maintainers
This module is maintained by the OCA.
diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml
index 9379342d07..aab97dd74c 100644
--- a/setup/_metapackage/pyproject.toml
+++ b/setup/_metapackage/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "odoo-addons-oca-storage"
-version = "18.0.20260520.0"
+version = "18.0.20260527.0"
dependencies = [
"odoo-addon-fs_attachment==18.0.*",
"odoo-addon-fs_attachment_s3==18.0.*",
@@ -10,6 +10,7 @@ dependencies = [
"odoo-addon-fs_folder_ms_drive==18.0.*",
"odoo-addon-fs_folder_webdav==18.0.*",
"odoo-addon-fs_image==18.0.*",
+ "odoo-addon-fs_image_thumbnail==18.0.*",
"odoo-addon-fs_storage==18.0.*",
"odoo-addon-fs_storage_ms_drive==18.0.*",
"odoo-addon-image_tag==18.0.*",







