Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -445,5 +450,6 @@ diff --git a/README.md b/README.md
index 55049bffc6..c83efd8cf0 100644
--- a/README.md
+++ b/README.md
@@ -24,24 +24,24 @@ addon | version | maintainers | summary
[fs_attachment](fs_attachment/) | 18.0.2.2.0 |
| Store attachments on external object store
[fs_attachment_s3](fs_attachment_s3/) | 18.0.1.2.0 |
| Store attachments into S3 complient filesystem
[fs_file](fs_file/) | 18.0.1.0.0 |
| Field to store files into filesystem storages
-[fs_folder](fs_folder/) | 18.0.1.0.1 |
| A module to link to Odoo records and manage from record forms forlders from external file systems
+[fs_folder](fs_folder/) | 18.0.2.0.0 |
| A module to link to Odoo records and manage from record forms forlders from external file systems
[fs_folder_demo](fs_folder_demo/) | 18.0.1.0.0 | | Demo for fs_folder addon
-[fs_folder_ms_drive](fs_folder_ms_drive/) | 18.0.1.0.0 |
| Display and manage your files from Microsoft drives from within Odoo
+[fs_folder_ms_drive](fs_folder_ms_drive/) | 18.0.2.0.0 |
| Display and manage your files from Microsoft drives from within Odoo
[fs_folder_webdav](fs_folder_webdav/) | 18.0.1.0.0 |
| UI improvement when managing WebDAV folder
[fs_image](fs_image/) | 18.0.1.0.0 |
| Field to store images into filesystem storages
[fs_storage](fs_storage/) | 18.0.2.1.0 | | Implement the concept of Storage with amazon S3, sftp...
-[fs_storage_ms_drive](fs_storage_ms_drive/) | 18.0.1.0.0 |
| Add the microsoft drives (OneDrive, Sharepoint) as a storage backend
+[fs_storage_ms_drive](fs_storage_ms_drive/) | 18.0.2.0.0 |
| Add the microsoft drives (OneDrive, Sharepoint) as a storage backend
[image_tag](image_tag/) | 18.0.1.0.0 | | Image tag model
-[microsoft_drive_account](microsoft_drive_account/) | 18.0.1.0.1 |
| Link user with Microsoft
+[microsoft_drive_account](microsoft_drive_account/) | 18.0.2.0.0 |
| Link user with Microsoft
[storage_backend](storage_backend/) | 18.0.1.0.0 | | Implement the concept of Storage with amazon S3, sftp...
[storage_backend_ftp](storage_backend_ftp/) | 18.0.1.0.0 | | Implement FTP Storage
[storage_backend_s3](storage_backend_s3/) | 18.0.1.1.0 | | Implement amazon S3 Storage
[storage_backend_sftp](storage_backend_sftp/) | 18.0.1.0.0 | | Implement SFTP Storage
[storage_file](storage_file/) | 18.0.1.0.0 | | Storage file in storage backend
-[storage_image](storage_image/) | 18.0.1.0.0 | | Store image and resized image in a storage backend
+[storage_image](storage_image/) | 18.0.1.0.1 | | Store image and resized image in a storage backend
[storage_image_product](storage_image_product/) | 18.0.1.0.1 | | Link images to products and categories
-[storage_media](storage_media/) | 18.0.1.1.0 | | Give the posibility to store media data in Odoo
-[storage_media_product](storage_media_product/) | 18.0.1.0.0 | | Link media to products and categories
+[storage_media](storage_media/) | 18.0.1.1.1 | | Give the posibility to store media data in Odoo
+[storage_media_product](storage_media_product/) | 18.0.1.0.1 | | Link media to products and categories
[storage_thumbnail](storage_thumbnail/) | 18.0.1.0.0 | | Abstract module that add the possibility to have thumbnail
[//]: # (end addons)
diff --git a/fs_attachment/README.rst b/fs_attachment/README.rst
index 72faaffa68..74a6659c50 100644
--- a/fs_attachment/README.rst
+++ b/fs_attachment/README.rst
@@ -11,7 +11,7 @@ Base Attachment Object Store
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:91e056fd2f97577445c98f8a29b6172922bd12ca6d3723cda39a40848f97ef5a
+ !! source digest: sha256:50c6082aeb8a70f8037fe7af4499b73d24c5e70f2fb76df63606559a6700108d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -331,6 +331,17 @@ Tips & Tricks
storage to the production environment to make it read only. (The use
of server environment files is a good way to do so).
+- When enabling ``Use As Default For Attachment`` you must be aware that
+ this option applies from the point when the ``fs_attachment`` has been
+ loaded by Odoo. This means that some attachments (such as icons)
+ created during the update of modules that are loaded before
+ ``fs_attachment`` will still be stored in the location defined in the
+ ``ir_attachment.location`` system parameter (which is ``file`` by
+ default, meaning the regular on-disk ``filestore`` directory).
+
+ A simple way to work around this issue is to set the
+ ``ir_attachment.location`` System Parameter record to ``db``.
+
Changelog
=========
diff --git a/fs_attachment/i18n/de.po b/fs_attachment/i18n/de.po
new file mode 100644
index 0000000000..c125de4eef
--- /dev/null
+++ b/fs_attachment/i18n/de.po
@@ -0,0 +1,310 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * fs_attachment
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 18.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#. module: fs_attachment
+#: model:ir.model,name:fs_attachment.model_ir_attachment
+#: model_terms:ir.ui.view,arch_db:fs_attachment.fs_storage_form_view
+msgid "Attachment"
+msgstr ""
+
+#. module: fs_attachment
+#: model_terms:ir.ui.view,arch_db:fs_attachment.fs_storage_form_view
+msgid "Attachment's Url"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__autovacuum_gc
+msgid "Autovacuum Garbage Collection"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__base_url
+msgid "Base Url"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__base_url_for_files
+msgid "Base Url For Files"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model,name:fs_attachment.model_fs_storage
+msgid "FS Storage"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_ir_attachment__fs_filename
+#: model:ir.model.fields,field_description:fs_attachment.field_product_document__fs_filename
+msgid "File Name into the filesystem storage"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model,name:fs_attachment.model_ir_binary
+msgid "File streaming helper model for controllers"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_ir_attachment__fs_storage_id
+#: model:ir.model.fields,field_description:fs_attachment.field_product_document__fs_storage_id
+msgid "Filesystem Storage"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_ir_attachment__fs_storage_code
+#: model:ir.model.fields,field_description:fs_attachment.field_product_document__fs_storage_code
+msgid "Filesystem Storage Code"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_ir_attachment__fs_url
+#: model:ir.model.fields,field_description:fs_attachment.field_product_document__fs_url
+msgid "Filesystem URL"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_ir_attachment__fs_url_path
+#: model:ir.model.fields,field_description:fs_attachment.field_product_document__fs_url_path
+msgid "Filesystem URL Path"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model,name:fs_attachment.model_fs_file_gc
+msgid "Filesystem storage file garbage collector"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__force_db_for_default_attachment_rules
+msgid "Force Db For Default Attachment Rules"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__id
+msgid "ID"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__use_x_sendfile_to_serve_internal_url
+msgid ""
+"If checked and odoo is behind a proxy that supports x-sendfile, the content "
+"served by the attachment's internal URL will be servedby the proxy using the"
+" fs_url if defined. If not, the file will be served by odoo that will stream"
+" the content read from the filesystem storage. This option is useful to "
+"avoid to serve files from odoo and therefore to avoid to load the odoo "
+"process. "
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__autovacuum_gc
+msgid ""
+"If checked, the autovacuum of the garbage collection will be automatically "
+"executed when the storage is used to store attachments. Sometime, the "
+"autovacuum is to avoid when files in the storage are referenced by other "
+"systems (like a website). In such case, records in the fs.file.gc table must"
+" be manually processed."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__optimizes_directory_path
+msgid ""
+"If checked, the directory path will be optimized to avoid too much files "
+"into the same directory. This options is used when the storage is used to "
+"store attachments. Depending on the storage, this option can be ignored. "
+"It's useful for storage based on real file. This way, files with similar "
+"properties will be stored in the same directory, avoiding overcrowding in "
+"the root directory and optimizing access times."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__use_filename_obfuscation
+msgid ""
+"If checked, the filename will be obfuscated. This option is useful to avoid "
+"to expose sensitive information trough the URL or in the remote storage. The"
+" obfuscation is done using a hash of the filename. The original filename is "
+"stored in the attachment metadata. The obfusation is to avoid if the storage"
+" is used to store files that are referenced by other systems (like a "
+"website) where the filename is important for SEO."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__use_as_default_for_attachments
+msgid "If checked, this storage will be used to store all the attachments "
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_ir_attachment__internal_url
+#: model:ir.model.fields,field_description:fs_attachment.field_product_document__internal_url
+msgid "Internal URL"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__is_directory_path_in_url
+msgid "Is Directory Path In Url"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__is_directory_path_in_url
+msgid ""
+"Normally the directory_path is for internal usage. If this flag is enabled "
+"the path will be used to compute the public URL."
+msgstr ""
+
+#. module: fs_attachment
+#. odoo-python
+#: code:addons/fs_attachment/models/ir_attachment.py:0
+msgid "Only administrators can execute this action."
+msgstr ""
+
+#. module: fs_attachment
+#. odoo-python
+#: code:addons/fs_attachment/models/fs_storage.py:0
+msgid "Only one storage can be used as default for attachments"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__optimizes_directory_path
+msgid "Optimizes Directory Path"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__fs_storage_code
+msgid "Storage Code"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_file_gc__store_fname
+msgid "Stored Filename"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_ir_attachment__fs_storage_code
+#: model:ir.model.fields,help:fs_attachment.field_product_document__fs_storage_code
+msgid ""
+"Technical code used to identify the storage backend into the code.This code "
+"must be unique. This code is used for example to define the storage backend "
+"to store the attachments via the configuration parameter "
+"'ir_attachment.storage.force.database' when the module 'fs_attachment' is "
+"installed."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_ir_attachment__fs_url
+#: model:ir.model.fields,help:fs_attachment.field_product_document__fs_url
+msgid "The URL to access the file from the filesystem storage."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_ir_attachment__internal_url
+#: model:ir.model.fields,help:fs_attachment.field_product_document__internal_url
+msgid "The URL to access the file from the server."
+msgstr ""
+
+#. module: fs_attachment
+#. odoo-python
+#: code:addons/fs_attachment/models/fs_storage.py:0
+msgid ""
+"The force_db_for_default_attachment_rules can only be set if the storage is "
+"used as default for attachments."
+msgstr ""
+
+#. module: fs_attachment
+#. odoo-python
+#: code:addons/fs_attachment/models/fs_storage.py:0
+msgid "The force_db_for_default_attachment_rules is not a valid python dict."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_ir_attachment__fs_filename
+#: model:ir.model.fields,help:fs_attachment.field_product_document__fs_filename
+msgid ""
+"The name of the file in the filesystem storage.To preserve the mimetype and "
+"the meaning of the filenamethe filename is computed from the name and the "
+"extension"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_ir_attachment__fs_url_path
+#: model:ir.model.fields,help:fs_attachment.field_product_document__fs_url_path
+msgid "The path to access the file from the filesystem storage."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_ir_attachment__fs_storage_id
+#: model:ir.model.fields,help:fs_attachment.field_product_document__fs_storage_id
+msgid "The storage where the file is stored."
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.constraint,message:fs_attachment.constraint_fs_file_gc_store_fname_uniq
+msgid "The stored filename must be unique!"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__use_as_default_for_attachments
+msgid "Use As Default For Attachments"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__use_filename_obfuscation
+msgid "Use Filename Obfuscation"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,field_description:fs_attachment.field_fs_storage__use_x_sendfile_to_serve_internal_url
+msgid "Use X-Sendfile To Serve Internal Url"
+msgstr ""
+
+#. module: fs_attachment
+#: model:ir.model.fields,help:fs_attachment.field_fs_storage__force_db_for_default_attachment_rules
+msgid ""
+"When storing attachments in an external storage, storage may be slow.If the storage is used to store odoo attachments by default, this could lead to a bad user experience since small images (128, 256) are used in Odoo in list / kanban views. We want them to be fast to read.This field allows to force the store of some attachments in the odoo database. The value is a dict Where the key is the beginning of the mimetype to configure and the value is the limit in size below which attachments are kept in DB. 0 means no limit.\n"
+"Default configuration means:\n"
+"* images mimetypes (image/png, image/jpeg, ...) below 50KB are stored in database\n"
+"* application/javascript are stored in database whatever their size \n"
+"* text/css are stored in database whatever their size"
+msgstr ""
+
+#. module: fs_attachment
+#. odoo-python
+#: code:addons/fs_attachment/models/ir_attachment.py:0
+msgid ""
+"You can't write on multiple attachments with different mimetypes at the same"
+" time."
+msgstr ""
diff --git a/fs_attachment/readme/USAGE.md b/fs_attachment/readme/USAGE.md
index 098a8035a1..6283ddb40d 100644
--- a/fs_attachment/readme/USAGE.md
+++ b/fs_attachment/readme/USAGE.md
@@ -238,3 +238,14 @@ with attachment.open("w", new_version=False) as f:
the production storage. Be careful to adapt the configuration of your
storage to the production environment to make it read only. (The use
of server environment files is a good way to do so).
+
+- When enabling `Use As Default For Attachment` you must be aware that this
+ option applies from the point when the `fs_attachment` has been loaded by
+ Odoo. This means that some attachments (such as icons) created during the
+ update of modules that are loaded before `fs_attachment` will still be stored
+ in the location defined in the `ir_attachment.location` system parameter
+ (which is `file` by default, meaning the regular on-disk `filestore`
+ directory).
+
+ A simple way to work around this issue is to set the `ir_attachment.location`
+ System Parameter record to `db`.
diff --git a/fs_attachment/static/description/index.html b/fs_attachment/static/description/index.html
index 35050930c5..f1efd603d0 100644
--- a/fs_attachment/static/description/index.html
+++ b/fs_attachment/static/description/index.html
@@ -372,7 +372,7 @@
In some cases, you need to store attachment in another system that the @@ -682,6 +682,16 @@
When enabling Use As Default For Attachment you must be aware that +this option applies from the point when the fs_attachment has been +loaded by Odoo. This means that some attachments (such as icons) +created during the update of modules that are loaded before +fs_attachment will still be stored in the location defined in the +ir_attachment.location system parameter (which is file by +default, meaning the regular on-disk filestore directory).
+A simple way to work around this issue is to set the +ir_attachment.location System Parameter record to db.
+If you need to link some specific models to a specific folder into an diff --git a/fs_folder_ms_drive/README.rst b/fs_folder_ms_drive/README.rst index ce40e0bb04..942e6c215b 100644 --- a/fs_folder_ms_drive/README.rst +++ b/fs_folder_ms_drive/README.rst @@ -11,7 +11,7 @@ Fs Folder Msgraph !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:02d58557bc81f6c929e4a6cda93337eb1cab4a69150544a559cc7763213fede6 + !! source digest: sha256:8475ca385cf7a41f81567b0d21543d204cab1256715b64c1e5ffe3f2c6d8746d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/fs_folder_ms_drive/__manifest__.py b/fs_folder_ms_drive/__manifest__.py index 3050076a49..c59d666cf7 100644 --- a/fs_folder_ms_drive/__manifest__.py +++ b/fs_folder_ms_drive/__manifest__.py @@ -5,7 +5,7 @@ "name": "Fs Folder Msgraph", "summary": """Display and manage your files from Microsoft drives from within Odoo""", - "version": "18.0.1.0.0", + "version": "18.0.2.0.0", "license": "LGPL-3", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/storage", diff --git a/fs_folder_ms_drive/models/fs_folder_field_value_adapter.py b/fs_folder_ms_drive/models/fs_folder_field_value_adapter.py index a9783d3efd..2afc535266 100644 --- a/fs_folder_ms_drive/models/fs_folder_field_value_adapter.py +++ b/fs_folder_ms_drive/models/fs_folder_field_value_adapter.py @@ -42,9 +42,10 @@ def _parse_fs_folder_value( ref, storage_code = super()._parse_fs_folder_value(stored_value, field, record) if ref: fs = record.env["fs.storage"].sudo().get_fs_by_code(storage_code) - if ( - self._is_msgraph_folder(fs) - and self.env.user.microsoft_drive_status == "connected" + user = record.env.user + if self._is_msgraph_folder(fs) and ( + user.microsoft_drive_oauth2_non_interactive + or user.microsoft_drive_status == "connected" ): fs_info = fs.info(path=ref, item_id=ref, details=False) ref = fs_info.get("name") diff --git a/fs_folder_ms_drive/static/description/index.html b/fs_folder_ms_drive/static/description/index.html index d1b563e596..ad6a8f0e6d 100644 --- a/fs_folder_ms_drive/static/description/index.html +++ b/fs_folder_ms_drive/static/description/index.html @@ -372,7 +372,7 @@
This addon extends the functionality of the fs_folder addon by diff --git a/fs_storage_ms_drive/README.rst b/fs_storage_ms_drive/README.rst index e72ea5c020..da5567b753 100644 --- a/fs_storage_ms_drive/README.rst +++ b/fs_storage_ms_drive/README.rst @@ -11,7 +11,7 @@ Filesystem Storage For Microsoft Drives !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:b5c56d23130eafeaaad1b4ab5a776a5464631a2ade4f354b1fed51a23f7f2ada + !! source digest: sha256:df7785300281b10d81235b3a18890ef221f066aa37399355155535b5c82d9575 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/fs_storage_ms_drive/__manifest__.py b/fs_storage_ms_drive/__manifest__.py index 159aba08e3..b985e3f272 100644 --- a/fs_storage_ms_drive/__manifest__.py +++ b/fs_storage_ms_drive/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Filesystem Storage For Microsoft Drives", "summary": "Add the microsoft drives (OneDrive, Sharepoint) as a storage backend", - "version": "18.0.1.0.0", + "version": "18.0.2.0.0", "category": "FS Storage", "website": "https://github.com/OCA/storage", "author": " ACSONE SA/NV, Odoo Community Association (OCA)", diff --git a/fs_storage_ms_drive/models/fs_storage.py b/fs_storage_ms_drive/models/fs_storage.py index 5948d18218..24c0619601 100644 --- a/fs_storage_ms_drive/models/fs_storage.py +++ b/fs_storage_ms_drive/models/fs_storage.py @@ -23,15 +23,17 @@ def _get_filesystem(self): while hasattr(root_fs, "fs"): root_fs = fs.fs client = root_fs.client - client.register_compliance_hook( - "refresh_token_response", - partial( - self.update_refresh_token_on_user, - client=client, - db_name=self._cr.dbname, - user_id=self.env.user.id, - ), - ) + if not self.env.user.microsoft_drive_oauth2_non_interactive: + # In interactive mode, we need to update the refresh token on user + client.register_compliance_hook( + "refresh_token_response", + partial( + self.update_refresh_token_on_user, + client=client, + db_name=self._cr.dbname, + user_id=self.env.user.id, + ), + ) return fs @api.model diff --git a/fs_storage_ms_drive/models/res_user.py b/fs_storage_ms_drive/models/res_user.py index df47a4b2be..e599f65232 100644 --- a/fs_storage_ms_drive/models/res_user.py +++ b/fs_storage_ms_drive/models/res_user.py @@ -14,26 +14,31 @@ def _get_oauth2_client_params(self): return { "client_id": get_param("microsoft_drive_client_id"), "client_secret": get_param("microsoft_drive_client_secret"), - "scope": self.env["microsoft.service"]._get_drive_scope(), "token_endpoint": get_param("microsoft_account.token_endpoint"), } def _get_oauth2_params(self): self.ensure_one() - access_token = self.microsoft_drive_token - rtoken = self.microsoft_drive_rtoken - expires_at = -1 - if self.microsoft_drive_token_validity: - # Convert datetime to timestamp - # This is needed for compatibility with authlib - # which expects an integer timestamp. - # If the token validity is not set, we use -1 to indicate no expiry. - expires_at = int(self.microsoft_drive_token_validity.timestamp()) - token = { - "access_token": access_token, - "refresh_token": rtoken, - "expires_at": expires_at, - } params = self._get_oauth2_client_params() - params.update(token=token) + if self.microsoft_drive_oauth2_non_interactive: + params["grant_type"] = "client_credentials" + params["scope"] = "https://graph.microsoft.com/.default" + else: + params["grant_type"] = "refresh_token" + params["scope"] = self.env["microsoft.service"]._get_drive_scope() + access_token = self.microsoft_drive_token + rtoken = self.microsoft_drive_rtoken + expires_at = -1 + if self.microsoft_drive_token_validity: + # Convert datetime to timestamp + # This is needed for compatibility with authlib + # which expects an integer timestamp. + # If the token validity is not set, we use -1 to indicate no expiry. + expires_at = int(self.microsoft_drive_token_validity.timestamp()) + token = { + "access_token": access_token, + "refresh_token": rtoken, + "expires_at": expires_at, + } + params["token"] = token return params diff --git a/fs_storage_ms_drive/static/description/index.html b/fs_storage_ms_drive/static/description/index.html index 42c2977a08..cf0825f774 100644 --- a/fs_storage_ms_drive/static/description/index.html +++ b/fs_storage_ms_drive/static/description/index.html @@ -372,7 +372,7 @@
This addon extends the functionality of the
diff --git a/microsoft_drive_account/README.rst b/microsoft_drive_account/README.rst
index 42ab02c1b0..0ef07caa93 100644
--- a/microsoft_drive_account/README.rst
+++ b/microsoft_drive_account/README.rst
@@ -11,7 +11,7 @@ Microsoft account for Drive
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:9af9b397644105b4196de7943e2e59df8923eade71212bb4569b7ed85359c4ac
+ !! source digest: sha256:45da0ca6403c800cbb29675b06c2f9065eed5626758a2c4d80391d732c38e8d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/microsoft_drive_account/__manifest__.py b/microsoft_drive_account/__manifest__.py
index 4556440091..2b396ce77e 100644
--- a/microsoft_drive_account/__manifest__.py
+++ b/microsoft_drive_account/__manifest__.py
@@ -5,7 +5,7 @@
"name": "Microsoft account for Drive",
"summary": """
Link user with Microsoft """,
- "version": "18.0.1.0.1",
+ "version": "18.0.2.0.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/storage",
diff --git a/microsoft_drive_account/i18n/it.po b/microsoft_drive_account/i18n/it.po
index 9bfd568ad8..4aaf7a6083 100644
--- a/microsoft_drive_account/i18n/it.po
+++ b/microsoft_drive_account/i18n/it.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2025-09-17 10:42+0000\n"
+"PO-Revision-Date: 2025-12-11 09:42+0000\n"
"Last-Translator: mymage This addon allows the user to link their Microsoft Drive account to
diff --git a/microsoft_drive_account/views/res_users.xml b/microsoft_drive_account/views/res_users.xml
index b20ac1fcb8..ea07689c88 100644
--- a/microsoft_drive_account/views/res_users.xml
+++ b/microsoft_drive_account/views/res_users.xml
@@ -9,8 +9,13 @@
External image management depending on Storage File module. It include these features: 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
@@ -403,15 +408,15 @@ Do not contact contributors directly about support or help with technical issues. The migration of this module from 15.0 to 18.0 was financially supported
by Camptocamp.Microsoft account for Drive
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:9af9b397644105b4196de7943e2e59df8923eade71212bb4569b7ed85359c4ac
+!! source digest: sha256:45da0ca6403c800cbb29675b06c2f9065eed5626758a2c4d80391d732c38e8d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
Storage Image
+
+
+
Storage Image
-
+
@@ -395,7 +400,7 @@
Storage Image
Bug Tracker
+Bug Tracker
Bug Tracker
Credits
+Credits
Contributors
+Contributors
Contributors
Other credits
+Other credits