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 | lmignon | Store attachments on external object store [fs_attachment_s3](fs_attachment_s3/) | 18.0.1.2.0 | lmignon | Store attachments into S3 complient filesystem [fs_file](fs_file/) | 18.0.1.0.0 | lmignon | Field to store files into filesystem storages -[fs_folder](fs_folder/) | 18.0.1.0.1 | lmignon | 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 | lmignon | 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 | lmignon | Display and manage your files from Microsoft drives from within Odoo +[fs_folder_ms_drive](fs_folder_ms_drive/) | 18.0.2.0.0 | lmignon | Display and manage your files from Microsoft drives from within Odoo [fs_folder_webdav](fs_folder_webdav/) | 18.0.1.0.0 | jguenat | UI improvement when managing WebDAV folder [fs_image](fs_image/) | 18.0.1.0.0 | lmignon | 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 | lmignon | Add the microsoft drives (OneDrive, Sharepoint) as a storage backend +[fs_storage_ms_drive](fs_storage_ms_drive/) | 18.0.2.0.0 | lmignon | 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 | lmignon | Link user with Microsoft +[microsoft_drive_account](microsoft_drive_account/) | 18.0.2.0.0 | lmignon | 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 @@

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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

In some cases, you need to store attachment in another system that the @@ -682,6 +682,16 @@

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.

    +
  • diff --git a/fs_folder/README.rst b/fs_folder/README.rst index f7a9f305c9..ad6c273206 100644 --- a/fs_folder/README.rst +++ b/fs_folder/README.rst @@ -11,7 +11,7 @@ Fs Folder !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:f9f52c117ff322405dc8a42c41aa4bdef26c9c95613ce2694b718b5d2d16ab0b + !! source digest: sha256:4085455207c434600a5db8b91a0ae7f89808a7061387200fa7147fda9e52715c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/fs_folder/__manifest__.py b/fs_folder/__manifest__.py index 9e765267d3..7b891d0e0c 100644 --- a/fs_folder/__manifest__.py +++ b/fs_folder/__manifest__.py @@ -5,7 +5,7 @@ "name": "Fs Folder", "summary": """A module to link to Odoo records and manage from record forms forlders from external file systems """, - "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/fs_folder/fields.py b/fs_folder/fields.py index f1d92c8916..d539f4eac2 100644 --- a/fs_folder/fields.py +++ b/fs_folder/fields.py @@ -1,5 +1,6 @@ # Copyright 2024 ACSONE SA/NV # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +import logging import threading import time import typing @@ -7,7 +8,7 @@ import fsspec -from odoo import SUPERUSER_ID, api, fields, models, registry +from odoo import api, fields, models, registry from odoo.tools.misc import SENTINEL, Sentinel from odoo.tools.sql import pg_varchar @@ -15,6 +16,8 @@ from .models.fs_storage import FsStorage +_logger = logging.getLogger(__name__) + class FsContentValue: def __init__( @@ -352,14 +355,17 @@ def create_value_in_fs(self, records: models.BaseModel) -> list[FsFolderValue]: fs.mkdir(path, **kwargs) - def clean_up_folder(path, storage_code, dbname): + def clean_up_folder(path, storage_code, dbname, user_id): db_registry = registry(dbname) with db_registry.cursor() as cr: - env = api.Environment(cr, SUPERUSER_ID, {}) + env = api.Environment(cr, user_id, {}) fs = env["fs.storage"].get_fs_by_code(storage_code) time.sleep(0.5) # wait creation into the filesystem - fs.rm(path, recursive=True) - # remove created resource in case of rollback + try: + # remove created resource in case of rollback + fs.rm(path, recursive=True) + except Exception as e: + _logger.exception(f"Error cleaning up folder {path}: {e}") test_mode = getattr(threading.current_thread(), "testing", False) if not test_mode: @@ -369,6 +375,7 @@ def clean_up_folder(path, storage_code, dbname): path, storage_code, record.env.cr.dbname, + record.env.user.id, ), ) diff --git a/fs_folder/static/description/index.html b/fs_folder/static/description/index.html index 1b85175d90..29220310e5 100644 --- a/fs_folder/static/description/index.html +++ b/fs_folder/static/description/index.html @@ -372,7 +372,7 @@

    Fs Folder

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:f9f52c117ff322405dc8a42c41aa4bdef26c9c95613ce2694b718b5d2d16ab0b +!! source digest: sha256:4085455207c434600a5db8b91a0ae7f89808a7061387200fa7147fda9e52715c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    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 @@

    Fs Folder Msgraph

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:02d58557bc81f6c929e4a6cda93337eb1cab4a69150544a559cc7763213fede6 +!! source digest: sha256:8475ca385cf7a41f81567b0d21543d204cab1256715b64c1e5ffe3f2c6d8746d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    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 @@

    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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    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 \n" "Language-Team: none\n" "Language: it\n" @@ -20,11 +20,14 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:microsoft_drive_account.res_users_simple_form_view msgid "" "\n" -" You are not connected to Drive. Click the button below to\n" +" You are not connected to Drive. Click the button " +"below to\n" " connect.\n" " \n" -" \n" -" You are connected to Drive. Click the button below to\n" +" \n" +" You are connected to Drive. Click the button " +"below to\n" " disconnect or reset your account.\n" " " msgstr "" @@ -33,8 +36,8 @@ msgstr "" "punsante sottostante per\n" " connettersi.\n" " \n" -" \n" +" \n" " Si è colleegati a Drive. Fare clic sul pulsante " "sottostante per \n" " disconnettersi o resettare il proprio account.\n" @@ -86,6 +89,20 @@ msgstr "Drive" msgid "ID" msgstr "ID" +#. module: microsoft_drive_account +#: model:ir.model.fields,help:microsoft_drive_account.field_res_users__microsoft_drive_oauth2_non_interactive +msgid "" +"If set, this user will not go through the interactive OAuth2 authorization " +"flow; The requested token will be requested to the authentication server " +"directly using client credentials flows. (scope: 'https://graph.microsoft." +"com/.default', grante_type: 'client_credentials')" +msgstr "" +"Se impostato, questo utente non passerà attraverso il flusso di " +"autorizzazione OAuth2 interattivo; il token richiesto verrà richiesto " +"direttamente al server di autenticazione tramite i flussi di credenziali " +"client. (ambito: 'https://graph.microsoft.com/.default', grante_type: " +"'client_credentials')" + #. module: microsoft_drive_account #: model:ir.model.fields,field_description:microsoft_drive_account.field_microsoft_drive_account_reset__write_uid msgid "Last Updated by" @@ -117,6 +134,11 @@ msgstr "Client_key Microsoft Drive" msgid "Microsoft Drive Connection Status" msgstr "Stato connessione Microsoft Drive" +#. module: microsoft_drive_account +#: model:ir.model.fields,field_description:microsoft_drive_account.field_res_users__microsoft_drive_oauth2_non_interactive +msgid "Microsoft Drive OAuth2 (non-interactive)" +msgstr "OAuth2 Microsoft Drive (non interattiva)" + #. module: microsoft_drive_account #: model:ir.model.fields,field_description:microsoft_drive_account.field_res_users__microsoft_drive_rtoken msgid "Microsoft Drive Refresh Token" diff --git a/microsoft_drive_account/i18n/microsoft_drive_account.pot b/microsoft_drive_account/i18n/microsoft_drive_account.pot index 9b783d15b3..854a951f9f 100644 --- a/microsoft_drive_account/i18n/microsoft_drive_account.pot +++ b/microsoft_drive_account/i18n/microsoft_drive_account.pot @@ -72,6 +72,15 @@ msgstr "" msgid "ID" msgstr "" +#. module: microsoft_drive_account +#: model:ir.model.fields,help:microsoft_drive_account.field_res_users__microsoft_drive_oauth2_non_interactive +msgid "" +"If set, this user will not go through the interactive OAuth2 authorization " +"flow; The requested token will be requested to the authentication server " +"directly using client credentials flows. (scope: " +"'https://graph.microsoft.com/.default', grante_type: 'client_credentials')" +msgstr "" + #. module: microsoft_drive_account #: model:ir.model.fields,field_description:microsoft_drive_account.field_microsoft_drive_account_reset__write_uid msgid "Last Updated by" @@ -103,6 +112,11 @@ msgstr "" msgid "Microsoft Drive Connection Status" msgstr "" +#. module: microsoft_drive_account +#: model:ir.model.fields,field_description:microsoft_drive_account.field_res_users__microsoft_drive_oauth2_non_interactive +msgid "Microsoft Drive OAuth2 (non-interactive)" +msgstr "" + #. module: microsoft_drive_account #: model:ir.model.fields,field_description:microsoft_drive_account.field_res_users__microsoft_drive_rtoken msgid "Microsoft Drive Refresh Token" diff --git a/microsoft_drive_account/models/res_users.py b/microsoft_drive_account/models/res_users.py index 584bff0907..49958811bd 100644 --- a/microsoft_drive_account/models/res_users.py +++ b/microsoft_drive_account/models/res_users.py @@ -26,6 +26,16 @@ class ResUsers(models.Model): store=True, ) + microsoft_drive_oauth2_non_interactive = fields.Boolean( + string="Microsoft Drive OAuth2 (non-interactive)", + default=False, + help="If set, this user will not go through the interactive OAuth2 " + "authorization flow; The requested token will be requested to the " + "authentication server directly using client credentials flows. " + "(scope: 'https://graph.microsoft.com/.default', " + "grante_type: 'client_credentials')", + ) + def _set_microsoft_drive_auth_tokens( self, access_token: str, refresh_token: str, ttl: float ): diff --git a/microsoft_drive_account/static/description/index.html b/microsoft_drive_account/static/description/index.html index bc63687193..03911a6b4d 100644 --- a/microsoft_drive_account/static/description/index.html +++ b/microsoft_drive_account/static/description/index.html @@ -372,7 +372,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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    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 @@ + + + - + -Storage Image +README.rst -

    -

    Storage Image

    +
    + + +Odoo Community Association + +
    +

    Storage Image

    -

    Production/Stable License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    +

    Production/Stable License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    External image management depending on Storage File module.

    It include these features:

      @@ -395,7 +400,7 @@

      Storage Image

    -

    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 @@ -403,15 +408,15 @@

    Bug Tracker

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Akretion
    -

    Contributors

    +

    Contributors

    -

    Other credits

    +

    Other credits

    The migration of this module from 15.0 to 18.0 was financially supported by Camptocamp.

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association @@ -445,5 +450,6 @@

    Maintainers

    +
    diff --git a/storage_image/tests/test_storage_replace_file.py b/storage_image/tests/test_storage_replace_file.py index fbe52b6005..985f704191 100644 --- a/storage_image/tests/test_storage_replace_file.py +++ b/storage_image/tests/test_storage_replace_file.py @@ -57,3 +57,4 @@ def test_wizard_change_file(self): # And ensure that the new file self.assertEqual(image.file_id.name, self.filename_1) self.assertEqual(image.file_id.data, self.filedata_1) + self.assertEqual(image.file_id.file_type, "image") diff --git a/storage_image/wizards/replace_file.py b/storage_image/wizards/replace_file.py index 1f7cd472ca..3698ab5d65 100644 --- a/storage_image/wizards/replace_file.py +++ b/storage_image/wizards/replace_file.py @@ -25,6 +25,12 @@ def default_get(self, fields_list): ) return res + def _prepare_file_values(self): + res = super()._prepare_file_values() + if self.image_id: + res["file_type"] = self.image_id._default_file_type + return res + def confirm(self): res = super().confirm() if self.image_id and self.data: diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index b6c2376d9f..b2300e7768 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "18.0.1.1.0", + "version": "18.0.1.1.1", "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", diff --git a/storage_media/migrations/18.0.1.1.1/pre-migrate.py b/storage_media/migrations/18.0.1.1.1/pre-migrate.py new file mode 100644 index 0000000000..3a267d191c --- /dev/null +++ b/storage_media/migrations/18.0.1.1.1/pre-migrate.py @@ -0,0 +1,26 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +import logging + +_logger = logging.getLogger(__name__) + + +def migrate(cr, version): + if not version: + return + _fix_missing_file_type(cr) + + +def _fix_missing_file_type(cr): + _logger.info("Fixing file associated to storage.media") + + query = """ + -- Set file_type = 'media' for files linked to storage_media + UPDATE storage_file sf + SET file_type = 'media' + FROM storage_media sm + WHERE sm.file_id = sf.id + AND (sf.file_type IS NULL OR sf.file_type = ''); + """ + cr.execute(query) diff --git a/storage_media/tests/test_storage_replace_file.py b/storage_media/tests/test_storage_replace_file.py index 528ce9b6e0..187be440c6 100644 --- a/storage_media/tests/test_storage_replace_file.py +++ b/storage_media/tests/test_storage_replace_file.py @@ -55,3 +55,4 @@ def test_wizard_change_file(self): # And ensure that the new file self.assertEqual(media.file_id.name, self.filename_1) self.assertEqual(media.file_id.data, self.filedata_1) + self.assertEqual(media.file_id.file_type, "media") diff --git a/storage_media/wizards/replace_file.py b/storage_media/wizards/replace_file.py index 6788323ae6..517521a590 100644 --- a/storage_media/wizards/replace_file.py +++ b/storage_media/wizards/replace_file.py @@ -25,10 +25,15 @@ def default_get(self, fields_list): ) return res + def _prepare_file_values(self): + res = super()._prepare_file_values() + if self.media_id: + res["file_type"] = self.media_id._default_file_type + return res + def confirm(self): res = super().confirm() if self.media_id and self.data: self.media_id.file_id = self._get_file_from_data() - # TODO remove sudo - self.media_id.file_id.sudo()._inverse_data() + self.media_id.file_id._inverse_data() return res diff --git a/storage_media_product/README.rst b/storage_media_product/README.rst index 909b062f9e..a59bde9257 100644 --- a/storage_media_product/README.rst +++ b/storage_media_product/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ===================== Storage Media Product ===================== @@ -7,13 +11,13 @@ Storage Media Product !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:32aed66f61d74e871094a5f149876cc38a028aebca8f3582b9cbcba09c6626a7 + !! source digest: sha256:1ebaac1a52437a2cde37c3583656a9c9185ac8e24068cf876aee4e93b654460d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github diff --git a/storage_media_product/__manifest__.py b/storage_media_product/__manifest__.py index fc1df6be33..43642eb1d2 100644 --- a/storage_media_product/__manifest__.py +++ b/storage_media_product/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media Product", "summary": "Link media to products and categories", - "version": "18.0.1.0.0", + "version": "18.0.1.0.1", "category": "Storage", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", diff --git a/storage_media_product/i18n/it.po b/storage_media_product/i18n/it.po index 2807859f85..b60968ce71 100644 --- a/storage_media_product/i18n/it.po +++ b/storage_media_product/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-04-08 06:29+0000\n" +"PO-Revision-Date: 2025-11-28 10:41+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -16,6 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 5.10.4\n" +#. module: storage_media_product +#: model:ir.model.fields,help:storage_media_product.field_product_media_relation__url_path +msgid "Accessible path, no base URL" +msgstr "Percorso accessibile, non URL base" + #. module: storage_media_product #: model_terms:ir.ui.view,arch_db:storage_media_product.product_media_relation_form msgid "Association" @@ -127,6 +132,11 @@ msgstr "Sequenza" msgid "Url" msgstr "URL" +#. module: storage_media_product +#: model:ir.model.fields,field_description:storage_media_product.field_product_media_relation__url_path +msgid "Url Path" +msgstr "Percorso URL" + #. module: storage_media_product #: model:ir.model.fields,field_description:storage_media_product.field_product_product__variant_media_ids msgid "Variant Media" diff --git a/storage_media_product/i18n/storage_media_product.pot b/storage_media_product/i18n/storage_media_product.pot index 868c443374..975eef8bd7 100644 --- a/storage_media_product/i18n/storage_media_product.pot +++ b/storage_media_product/i18n/storage_media_product.pot @@ -13,6 +13,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: storage_media_product +#: model:ir.model.fields,help:storage_media_product.field_product_media_relation__url_path +msgid "Accessible path, no base URL" +msgstr "" + #. module: storage_media_product #: model_terms:ir.ui.view,arch_db:storage_media_product.product_media_relation_form msgid "Association" @@ -124,6 +129,11 @@ msgstr "" msgid "Url" msgstr "" +#. module: storage_media_product +#: model:ir.model.fields,field_description:storage_media_product.field_product_media_relation__url_path +msgid "Url Path" +msgstr "" + #. module: storage_media_product #: model:ir.model.fields,field_description:storage_media_product.field_product_product__variant_media_ids msgid "Variant Media" diff --git a/storage_media_product/models/product.py b/storage_media_product/models/product.py index f2b99f7e15..12832b70af 100644 --- a/storage_media_product/models/product.py +++ b/storage_media_product/models/product.py @@ -57,9 +57,13 @@ class ProductMediaRelation(models.Model): compute="_compute_available_attribute", ) product_tmpl_id = fields.Many2one("product.template") + media_type_id = fields.Many2one( + "storage.media.type", "Media Type", related="media_id.media_type_id" + ) name = fields.Char(related="media_id.name", readonly=True) description = fields.Text() url = fields.Char(related="media_id.url", readonly=True) + url_path = fields.Char(related="media_id.url_path", readonly=True) media_type_id = fields.Many2one(related="media_id.media_type_id", readonly=True) @api.depends("media_id", "product_tmpl_id.attribute_line_ids.value_ids") diff --git a/storage_media_product/static/description/index.html b/storage_media_product/static/description/index.html index 0036108ada..ee918351b4 100644 --- a/storage_media_product/static/description/index.html +++ b/storage_media_product/static/description/index.html @@ -3,7 +3,7 @@ -Storage Media Product +README.rst -
    -

    Storage Media Product

    +
    + + +Odoo Community Association + +
    +

    Storage Media Product

    -

    Beta License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    +

    Beta License: LGPL-3 OCA/storage Translate me on Weblate Try me on Runboat

    Attach images to products and categories

    Table of contents

    @@ -391,16 +396,16 @@

    Storage Media Product

    -

    Usage

    +

    Usage

    -

    Categories

    +

    Categories

    • Go to Sales > Configuration > Products > Product Categories. A new field Image is available to upload or use an existing image.
    -

    Products

    +

    Products

    • Go to Sales > Products. In variants tab, after the attributes selection, you will find the images.
    • @@ -409,10 +414,10 @@

      Products

    -

    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 @@ -420,15 +425,15 @@

    Bug Tracker

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Akretion
    -

    Contributors

    +

    Contributors

    -

    Other credits

    +

    Other credits

    The migration of this module from 16.0 to 18.0 was financially supported by Camptocamp.

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association @@ -454,5 +459,6 @@

    Maintainers

    +