diff --git a/fs_attachment/__manifest__.py b/fs_attachment/__manifest__.py index 2c151b2378..66f6cb22be 100644 --- a/fs_attachment/__manifest__.py +++ b/fs_attachment/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Base Attachment Object Store", "summary": "Store attachments on external object store", - "version": "16.0.2.1.0", + "version": "16.0.3.0.0", "author": "Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA)", "license": "AGPL-3", "development_status": "Beta", diff --git a/fs_attachment/migrations/16.0.3.0.0/post-migration.py b/fs_attachment/migrations/16.0.3.0.0/post-migration.py new file mode 100644 index 0000000000..6d3ab374a9 --- /dev/null +++ b/fs_attachment/migrations/16.0.3.0.0/post-migration.py @@ -0,0 +1,16 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + if env["ir.module.module"].search( + [("name", "=", "server_environment"), ("state", "=", "installed")] + ): + openupgrade.logged_query( + env.cr, + """ + UPDATE ir_module_module + SET state = 'to install' + WHERE name = 'fs_attachment_environment' AND state = 'uninstalled' + """, + ) diff --git a/fs_attachment/models/fs_storage.py b/fs_attachment/models/fs_storage.py index 4df2085178..37746c2cdc 100644 --- a/fs_attachment/models/fs_storage.py +++ b/fs_attachment/models/fs_storage.py @@ -179,25 +179,6 @@ def _check_field_xmlid_storage_unique(self): % {"field": xmlid, "other_storage": other_storages[0].name} ) - @property - def _server_env_fields(self): - env_fields = super()._server_env_fields - env_fields.update( - { - "optimizes_directory_path": {}, - "autovacuum_gc": {}, - "base_url": {}, - "is_directory_path_in_url": {}, - "use_x_sendfile_to_serve_internal_url": {}, - "use_as_default_for_attachments": {}, - "force_db_for_default_attachment_rules": {}, - "use_filename_obfuscation": {}, - "model_xmlids": {}, - "field_xmlids": {}, - } - ) - return env_fields - @property def _default_force_db_for_default_attachment_rules(self) -> str: return '{"image/": 51200, "application/javascript": 0, "text/css": 0}' diff --git a/fs_attachment/tests/test_fs_storage.py b/fs_attachment/tests/test_fs_storage.py index f1dae79235..edab0b4e68 100644 --- a/fs_attachment/tests/test_fs_storage.py +++ b/fs_attachment/tests/test_fs_storage.py @@ -388,6 +388,7 @@ def test_url_for_image_dir_optimized_and_not_obfuscated(self): "name": "FS Product Image Backend", "code": "file", "base_url": "https://localhost/images", + "protocol": "odoofs", "optimizes_directory_path": True, "use_filename_obfuscation": False, } diff --git a/fs_attachment_environment/README.rst b/fs_attachment_environment/README.rst new file mode 100644 index 0000000000..3eb7db6388 --- /dev/null +++ b/fs_attachment_environment/README.rst @@ -0,0 +1,83 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================= +Filesystem Attachment Backend +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:bbd1be658bbe5cda3a0ca2391c1de17eafb45624ac49610b3b2503c65d2610af + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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/16.0/fs_attachment_environment + :alt: OCA/storage +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment_environment + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Glue module for fs_attachment to use fs_storage_environment + +**Table of contents** + +.. contents:: + :local: + +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 +* Dixmit + +Contributors +~~~~~~~~~~~~ + +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +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. diff --git a/fs_attachment_environment/__init__.py b/fs_attachment_environment/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fs_attachment_environment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fs_attachment_environment/__manifest__.py b/fs_attachment_environment/__manifest__.py new file mode 100644 index 0000000000..8e4f8ae33a --- /dev/null +++ b/fs_attachment_environment/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Dixmit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Filesystem Attachment Backend", + "summary": "Allows to use server environment with fs storage attachment", + "version": "16.0.1.0.0", + "category": "FS Storage", + "website": "https://github.com/OCA/storage", + "author": " ACSONE SA/NV, Dixmit, Odoo Community Association (OCA)", + "license": "AGPL-3", + "development_status": "Beta", + "installable": True, + "depends": ["fs_storage_environment", "fs_attachment"], + "data": [], + "auto_install": True, +} diff --git a/fs_attachment_environment/models/__init__.py b/fs_attachment_environment/models/__init__.py new file mode 100644 index 0000000000..349bb0495a --- /dev/null +++ b/fs_attachment_environment/models/__init__.py @@ -0,0 +1 @@ +from . import fs_storage diff --git a/fs_attachment_environment/models/fs_storage.py b/fs_attachment_environment/models/fs_storage.py new file mode 100644 index 0000000000..ba8bb9754c --- /dev/null +++ b/fs_attachment_environment/models/fs_storage.py @@ -0,0 +1,32 @@ +# Copyright 2023 ACSONE SA/NV (https://www.acsone.eu). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +from __future__ import annotations + +import logging + +from odoo import models + +_logger = logging.getLogger(__name__) + + +class FSStorage(models.Model): + _inherit = "fs.storage" + + @property + def _server_env_fields(self): + env_fields = super()._server_env_fields + env_fields.update( + { + "optimizes_directory_path": {}, + "autovacuum_gc": {}, + "base_url": {}, + "is_directory_path_in_url": {}, + "use_x_sendfile_to_serve_internal_url": {}, + "use_as_default_for_attachments": {}, + "force_db_for_default_attachment_rules": {}, + "use_filename_obfuscation": {}, + "model_xmlids": {}, + "field_xmlids": {}, + } + ) + return env_fields diff --git a/fs_attachment_environment/readme/CONTRIBUTORS.rst b/fs_attachment_environment/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..33b59e282e --- /dev/null +++ b/fs_attachment_environment/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella \ No newline at end of file diff --git a/fs_attachment_environment/readme/DESCRIPTION.rst b/fs_attachment_environment/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..2bd7b23f5a --- /dev/null +++ b/fs_attachment_environment/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Glue module for fs_attachment to use fs_storage_environment \ No newline at end of file diff --git a/fs_attachment_environment/static/description/icon.png b/fs_attachment_environment/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/fs_attachment_environment/static/description/icon.png differ diff --git a/fs_attachment_environment/static/description/index.html b/fs_attachment_environment/static/description/index.html new file mode 100644 index 0000000000..cbbfe22941 --- /dev/null +++ b/fs_attachment_environment/static/description/index.html @@ -0,0 +1,432 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Filesystem Attachment Backend

+ +

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

+

Glue module for fs_attachment to use fs_storage_environment

+

Table of contents

+ +
+

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
  • +
  • Dixmit
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

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.

+
+
+
+
+ + diff --git a/fs_attachment_s3/__manifest__.py b/fs_attachment_s3/__manifest__.py index 0b7e222345..4c859a3e2c 100644 --- a/fs_attachment_s3/__manifest__.py +++ b/fs_attachment_s3/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Fs Attachment S3", "summary": """Store attachments into S3 complient filesystem""", - "version": "16.0.2.1.1", + "version": "16.0.3.0.0", "license": "AGPL-3", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/storage", diff --git a/fs_attachment_s3/migrations/16.0.3.0.0/post-migration.py b/fs_attachment_s3/migrations/16.0.3.0.0/post-migration.py new file mode 100644 index 0000000000..dc879c01d4 --- /dev/null +++ b/fs_attachment_s3/migrations/16.0.3.0.0/post-migration.py @@ -0,0 +1,16 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + if env["ir.module.module"].search( + [("name", "=", "server_environment"), ("state", "=", "installed")] + ): + openupgrade.logged_query( + env.cr, + """ + UPDATE ir_module_module + SET state = 'to install' + WHERE name = 'fs_attachment_s3_environment' AND state = 'uninstalled' + """, + ) diff --git a/fs_attachment_s3/models/fs_storage.py b/fs_attachment_s3/models/fs_storage.py index dd7bfaea7e..3348f1acaa 100644 --- a/fs_attachment_s3/models/fs_storage.py +++ b/fs_attachment_s3/models/fs_storage.py @@ -23,18 +23,6 @@ class FsStorage(models.Model): "Default is 30 seconds.", ) - @property - def _server_env_fields(self): - """Override to include S3 specific fields.""" - fields = super()._server_env_fields - fields.update( - { - "s3_uses_signed_url_for_x_sendfile": {}, - "s3_signed_url_expiration": {}, - } - ) - return fields - @property def is_s3_storage(self): """Check if the storage is an S3 storage.""" diff --git a/fs_attachment_s3_environment/README.rst b/fs_attachment_s3_environment/README.rst new file mode 100644 index 0000000000..9dbd27f320 --- /dev/null +++ b/fs_attachment_s3_environment/README.rst @@ -0,0 +1,83 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================ +Filesystem Attachment Backend S3 +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:bbd1be658bbe5cda3a0ca2391c1de17eafb45624ac49610b3b2503c65d2610af + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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/16.0/fs_attachment_s3_environment + :alt: OCA/storage +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment_s3_environment + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Glue module for fs_attachment to use fs_storage_environment + +**Table of contents** + +.. contents:: + :local: + +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 +* Dixmit + +Contributors +~~~~~~~~~~~~ + +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +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. diff --git a/fs_attachment_s3_environment/__init__.py b/fs_attachment_s3_environment/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fs_attachment_s3_environment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fs_attachment_s3_environment/__manifest__.py b/fs_attachment_s3_environment/__manifest__.py new file mode 100644 index 0000000000..9f8a8639b5 --- /dev/null +++ b/fs_attachment_s3_environment/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Dixmit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Filesystem Attachment Backend S3", + "summary": "Allows to use server environment with fs storage attachment S3", + "version": "16.0.1.0.0", + "category": "FS Storage", + "website": "https://github.com/OCA/storage", + "author": " ACSONE SA/NV, Dixmit, Odoo Community Association (OCA)", + "license": "AGPL-3", + "development_status": "Beta", + "installable": True, + "depends": ["fs_attachment_environment", "fs_attachment_s3"], + "data": [], + "auto_install": True, +} diff --git a/fs_attachment_s3_environment/models/__init__.py b/fs_attachment_s3_environment/models/__init__.py new file mode 100644 index 0000000000..349bb0495a --- /dev/null +++ b/fs_attachment_s3_environment/models/__init__.py @@ -0,0 +1 @@ +from . import fs_storage diff --git a/fs_attachment_s3_environment/models/fs_storage.py b/fs_attachment_s3_environment/models/fs_storage.py new file mode 100644 index 0000000000..3057681e7a --- /dev/null +++ b/fs_attachment_s3_environment/models/fs_storage.py @@ -0,0 +1,25 @@ +# Copyright 2023 ACSONE SA/NV (https://www.acsone.eu). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +from __future__ import annotations + +import logging + +from odoo import models + +_logger = logging.getLogger(__name__) + + +class FSStorage(models.Model): + _inherit = "fs.storage" + + @property + def _server_env_fields(self): + """Override to include S3 specific fields.""" + fields = super()._server_env_fields + fields.update( + { + "s3_uses_signed_url_for_x_sendfile": {}, + "s3_signed_url_expiration": {}, + } + ) + return fields diff --git a/fs_attachment_s3_environment/readme/CONTRIBUTORS.rst b/fs_attachment_s3_environment/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..33b59e282e --- /dev/null +++ b/fs_attachment_s3_environment/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella \ No newline at end of file diff --git a/fs_attachment_s3_environment/readme/DESCRIPTION.rst b/fs_attachment_s3_environment/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..2bd7b23f5a --- /dev/null +++ b/fs_attachment_s3_environment/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Glue module for fs_attachment to use fs_storage_environment \ No newline at end of file diff --git a/fs_attachment_s3_environment/static/description/icon.png b/fs_attachment_s3_environment/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/fs_attachment_s3_environment/static/description/icon.png differ diff --git a/fs_attachment_s3_environment/static/description/index.html b/fs_attachment_s3_environment/static/description/index.html new file mode 100644 index 0000000000..e21048ace4 --- /dev/null +++ b/fs_attachment_s3_environment/static/description/index.html @@ -0,0 +1,432 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Filesystem Attachment Backend S3

+ +

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

+

Glue module for fs_attachment to use fs_storage_environment

+

Table of contents

+ +
+

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
  • +
  • Dixmit
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

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.

+
+
+
+
+ + diff --git a/fs_storage/README.rst b/fs_storage/README.rst index 4b0c19a03a..2b8f7d536c 100644 --- a/fs_storage/README.rst +++ b/fs_storage/README.rst @@ -153,56 +153,6 @@ the protocol options as follows: In this example, the SimpleCacheFileSystem protocol will be used as a wrapper around the odoofs protocol. -Server Environment -~~~~~~~~~~~~~~~~~~ - -To ease the management of the filesystem storages configuration accross the different -environments, the configuration of the filesystem storages can be defined in -environment files or directly in the main configuration file. For example, the -configuration of a filesystem storage with the code `fsprod` can be provided in the -main configuration file as follows: - -.. code-block:: ini - - [fs_storage.fsprod] - protocol=s3 - options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"} - directory_path=my_bucket - -To work, a `storage.backend` record must exist with the code `fsprod` into the database. -In your configuration section, you can specify the value for the following fields: - -* `protocol` -* `options` -* `directory_path` - -When evaluating directory_path, `{db_name}` is replaced by the database name. -This is usefull in multi-tenant with a setup completly controlled by -configuration files. - -Migration from storage_backend -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The fs_storage addon can be used to replace the storage_backend addon. (It has -been designed to be a drop-in replacement for the storage_backend addon). To -ease the migration, the `fs.storage` model defines the high-level methods -available in the storage_backend model. These methods are: - -* `add` -* `get` -* `list_files` -* `find_files` -* `move_files` -* `delete` - -These methods are wrappers around the methods of the `fsspec.AbstractFileSystem` -class (see https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem). -These methods are marked as deprecated and will be removed in a future version (V18) -of the addon. You should use the methods of the `fsspec.AbstractFileSystem` class -instead since they are more flexible and powerful. You can access the instance -of the `fsspec.AbstractFileSystem` class using the `fs` property of a `fs.storage` -record. - Known issues / Roadmap ====================== @@ -284,6 +234,7 @@ Contributors * Laurent Mignon * Sébastien BEAU +* Enric Tobella Maintainers ~~~~~~~~~~~ diff --git a/fs_storage/__manifest__.py b/fs_storage/__manifest__.py index e456b8db75..473de7a8b8 100644 --- a/fs_storage/__manifest__.py +++ b/fs_storage/__manifest__.py @@ -5,14 +5,14 @@ { "name": "Filesystem Storage Backend", "summary": "Implement the concept of Storage with amazon S3, sftp...", - "version": "16.0.1.5.0", + "version": "16.0.2.0.0", "category": "FS Storage", "website": "https://github.com/OCA/storage", "author": " ACSONE SA/NV, Odoo Community Association (OCA)", "license": "LGPL-3", "development_status": "Beta", "installable": True, - "depends": ["base", "base_sparse_field", "server_environment"], + "depends": ["base", "base_sparse_field"], "data": [ "views/fs_storage_view.xml", "security/ir.model.access.csv", diff --git a/fs_storage/migrations/16.0.2.0.0/post-migration.py b/fs_storage/migrations/16.0.2.0.0/post-migration.py new file mode 100644 index 0000000000..187a8b0c74 --- /dev/null +++ b/fs_storage/migrations/16.0.2.0.0/post-migration.py @@ -0,0 +1,16 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + if env["ir.module.module"].search( + [("name", "=", "server_environment"), ("state", "=", "installed")] + ): + openupgrade.logged_query( + env.cr, + """ + UPDATE ir_module_module + SET state = 'to install' + WHERE name = 'fs_storage_environment' AND state = 'uninstalled' + """, + ) diff --git a/fs_storage/models/fs_storage.py b/fs_storage/models/fs_storage.py index dbcf36bd03..6fe51fd1b6 100644 --- a/fs_storage/models/fs_storage.py +++ b/fs_storage/models/fs_storage.py @@ -88,7 +88,6 @@ def wrapper(self, *args, **kwargs): class FSStorage(models.Model): _name = "fs.storage" - _inherit = "server.env.mixin" _description = "FS Storage" __slots__ = ("__fs", "__odoo_storage_path") @@ -203,8 +202,6 @@ def __init__(self, env, ids=(), prefetch_ids=()): ), ] - _server_env_section_name_field = "code" - @api.model def _get_check_connection_method_selection(self): return [ @@ -212,16 +209,6 @@ def _get_check_connection_method_selection(self): ("ls", _("List File")), ] - @property - def _server_env_fields(self): - return { - "protocol": {}, - "options": {}, - "directory_path": {}, - "eval_options_from_env": {}, - "check_connection_method": {}, - } - @api.model_create_multi @prevent_call_from_safe_eval("create") def create(self, vals_list): diff --git a/fs_storage/readme/CONTRIBUTORS.rst b/fs_storage/readme/CONTRIBUTORS.rst index 60c32f1d3f..9c1df66351 100644 --- a/fs_storage/readme/CONTRIBUTORS.rst +++ b/fs_storage/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Laurent Mignon * Sébastien BEAU +* Enric Tobella diff --git a/fs_storage/readme/USAGE.rst b/fs_storage/readme/USAGE.rst index e9f9c25100..6275e9b9f7 100644 --- a/fs_storage/readme/USAGE.rst +++ b/fs_storage/readme/USAGE.rst @@ -46,53 +46,3 @@ the protocol options as follows: In this example, the SimpleCacheFileSystem protocol will be used as a wrapper around the odoofs protocol. - -Server Environment -~~~~~~~~~~~~~~~~~~ - -To ease the management of the filesystem storages configuration accross the different -environments, the configuration of the filesystem storages can be defined in -environment files or directly in the main configuration file. For example, the -configuration of a filesystem storage with the code `fsprod` can be provided in the -main configuration file as follows: - -.. code-block:: ini - - [fs_storage.fsprod] - protocol=s3 - options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"} - directory_path=my_bucket - -To work, a `storage.backend` record must exist with the code `fsprod` into the database. -In your configuration section, you can specify the value for the following fields: - -* `protocol` -* `options` -* `directory_path` - -When evaluating directory_path, `{db_name}` is replaced by the database name. -This is usefull in multi-tenant with a setup completly controlled by -configuration files. - -Migration from storage_backend -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The fs_storage addon can be used to replace the storage_backend addon. (It has -been designed to be a drop-in replacement for the storage_backend addon). To -ease the migration, the `fs.storage` model defines the high-level methods -available in the storage_backend model. These methods are: - -* `add` -* `get` -* `list_files` -* `find_files` -* `move_files` -* `delete` - -These methods are wrappers around the methods of the `fsspec.AbstractFileSystem` -class (see https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem). -These methods are marked as deprecated and will be removed in a future version (V18) -of the addon. You should use the methods of the `fsspec.AbstractFileSystem` class -instead since they are more flexible and powerful. You can access the instance -of the `fsspec.AbstractFileSystem` class using the `fs` property of a `fs.storage` -record. diff --git a/fs_storage/readme/newsfragments/627.feature.rst b/fs_storage/readme/newsfragments/627.feature.rst new file mode 100644 index 0000000000..0107afb987 --- /dev/null +++ b/fs_storage/readme/newsfragments/627.feature.rst @@ -0,0 +1 @@ +- Remove the dependancy of server_environment module and make fs_storage_environment a bridge between fs_storage and server_environment modules. \ No newline at end of file diff --git a/fs_storage/static/description/index.html b/fs_storage/static/description/index.html index ee8e8468a4..3d1b575399 100644 --- a/fs_storage/static/description/index.html +++ b/fs_storage/static/description/index.html @@ -438,24 +438,22 @@

Filesystem Storage Backend

  • Usage
  • -
  • Known issues / Roadmap
  • -
  • Changelog
    -

    Configuration

    +

    Configuration

    1. Go to Settings > Technical > FS Storage > FS Storage
    2. Select a filesystem you want to use for backups. NOTE: Make sure @@ -403,19 +408,19 @@

      Configuration

    -

    Usage

    +

    Usage

    The backup is done automatically by a scheduled action (Backup database and delete old backups).

    -

    Known issues / Roadmap

    +

    Known issues / Roadmap

    • Configurable backup frequency: e.g. backup every 7 days in s3 and every 4 hours on a FTP server.
    -

    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 @@ -423,21 +428,21 @@

    Bug Tracker

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

    + diff --git a/fs_storage_backup_environment/README.rst b/fs_storage_backup_environment/README.rst new file mode 100644 index 0000000000..25b821af53 --- /dev/null +++ b/fs_storage_backup_environment/README.rst @@ -0,0 +1,83 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================= +Filesystem Attachment Backend +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:bbd1be658bbe5cda3a0ca2391c1de17eafb45624ac49610b3b2503c65d2610af + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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/16.0/fs_storage_backup_environment + :alt: OCA/storage +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_storage_backup_environment + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Glue module for fs_storage_backup to use fs_storage_environment + +**Table of contents** + +.. contents:: + :local: + +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 +* Dixmit + +Contributors +~~~~~~~~~~~~ + +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +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. diff --git a/fs_storage_backup_environment/__init__.py b/fs_storage_backup_environment/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fs_storage_backup_environment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fs_storage_backup_environment/__manifest__.py b/fs_storage_backup_environment/__manifest__.py new file mode 100644 index 0000000000..9b4e4b242e --- /dev/null +++ b/fs_storage_backup_environment/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Dixmit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Filesystem Attachment Backend", + "summary": "Allows to use server environment with fs storage attachment", + "version": "16.0.1.0.0", + "category": "FS Storage", + "website": "https://github.com/OCA/storage", + "author": " ACSONE SA/NV, Dixmit, Odoo Community Association (OCA)", + "license": "AGPL-3", + "development_status": "Beta", + "installable": True, + "depends": ["fs_storage_environment", "fs_storage_backup"], + "data": [], + "auto_install": True, +} diff --git a/fs_storage_backup_environment/models/__init__.py b/fs_storage_backup_environment/models/__init__.py new file mode 100644 index 0000000000..349bb0495a --- /dev/null +++ b/fs_storage_backup_environment/models/__init__.py @@ -0,0 +1 @@ +from . import fs_storage diff --git a/fs_storage_backup_environment/models/fs_storage.py b/fs_storage_backup_environment/models/fs_storage.py new file mode 100644 index 0000000000..35afbbf754 --- /dev/null +++ b/fs_storage_backup_environment/models/fs_storage.py @@ -0,0 +1,27 @@ +# Copyright 2023 ACSONE SA/NV (https://www.acsone.eu). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from __future__ import annotations + +import logging + +from odoo import models + +_logger = logging.getLogger(__name__) + + +class FSStorage(models.Model): + _inherit = "fs.storage" + + @property + def _server_env_fields(self): + env_fields = super()._server_env_fields + env_fields.update( + { + "use_for_backup": {}, + "backup_include_filestore": {}, + "backup_filename_format": {"no_default_field": False}, + "backup_keep_time": {"no_default_field": False}, + "backup_dir": {"no_default_field": False}, + } + ) + return env_fields diff --git a/fs_storage_backup_environment/readme/CONTRIBUTORS.rst b/fs_storage_backup_environment/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..33b59e282e --- /dev/null +++ b/fs_storage_backup_environment/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella \ No newline at end of file diff --git a/fs_storage_backup_environment/readme/DESCRIPTION.rst b/fs_storage_backup_environment/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..6dfbf57667 --- /dev/null +++ b/fs_storage_backup_environment/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Glue module for fs_storage_backup to use fs_storage_environment \ No newline at end of file diff --git a/fs_storage_backup_environment/static/description/icon.png b/fs_storage_backup_environment/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/fs_storage_backup_environment/static/description/icon.png differ diff --git a/fs_storage_backup_environment/static/description/index.html b/fs_storage_backup_environment/static/description/index.html new file mode 100644 index 0000000000..c1f416ce43 --- /dev/null +++ b/fs_storage_backup_environment/static/description/index.html @@ -0,0 +1,432 @@ + + + + + +README.rst + + + +
    + + + +Odoo Community Association + +
    +

    Filesystem Attachment Backend

    + +

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

    +

    Glue module for fs_storage_backup to use fs_storage_environment

    +

    Table of contents

    + +
    +

    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
    • +
    • Dixmit
    • +
    +
    +
    +

    Contributors

    + +
    +
    +

    Maintainers

    +

    This module is maintained by the OCA.

    + +Odoo Community Association + +

    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.

    +

    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.

    +
    +
    +
    +
    + + diff --git a/fs_storage_environment/README.rst b/fs_storage_environment/README.rst new file mode 100644 index 0000000000..1ca21cbdea --- /dev/null +++ b/fs_storage_environment/README.rst @@ -0,0 +1,133 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========================== +Filesystem Storage Backend +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:bbd1be658bbe5cda3a0ca2391c1de17eafb45624ac49610b3b2503c65d2610af + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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 + :target: https://github.com/OCA/storage/tree/16.0/fs_storage_environment + :alt: OCA/storage +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_storage_environment + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to use server environment with fs storage. It is a bridge between fs_storage and server_environment modules. It provides an implementation of the StorageEnvironment class that uses the filesystem as a storage backend. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To ease the management of the filesystem storages configuration accross the different +environments, the configuration of the filesystem storages can be defined in +environment files or directly in the main configuration file. For example, the +configuration of a filesystem storage with the code `fsprod` can be provided in the +main configuration file as follows: + +.. code-block:: ini + + [fs_storage.fsprod] + protocol=s3 + options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"} + directory_path=my_bucket + +To work, a `storage.backend` record must exist with the code `fsprod` into the database. +In your configuration section, you can specify the value for the following fields: + +* `protocol` +* `options` +* `directory_path` + +When evaluating directory_path, `{db_name}` is replaced by the database name. +This is usefull in multi-tenant with a setup completly controlled by +configuration files. + +Migration from storage_backend +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The fs_storage addon can be used to replace the storage_backend addon. (It has +been designed to be a drop-in replacement for the storage_backend addon). To +ease the migration, the `fs.storage` model defines the high-level methods +available in the storage_backend model. These methods are: + +* `add` +* `get` +* `list_files` +* `find_files` +* `move_files` +* `delete` + +These methods are wrappers around the methods of the `fsspec.AbstractFileSystem` +class (see https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem). +These methods are marked as deprecated and will be removed in a future version (V18) +of the addon. You should use the methods of the `fsspec.AbstractFileSystem` class +instead since they are more flexible and powerful. You can access the instance +of the `fsspec.AbstractFileSystem` class using the `fs` property of a `fs.storage` +record. + +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 +* Dixmit + +Contributors +~~~~~~~~~~~~ + +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +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. diff --git a/fs_storage_environment/__init__.py b/fs_storage_environment/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fs_storage_environment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fs_storage_environment/__manifest__.py b/fs_storage_environment/__manifest__.py new file mode 100644 index 0000000000..9c665f6e1a --- /dev/null +++ b/fs_storage_environment/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2026 Dixmit +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +{ + "name": "Filesystem Storage Backend", + "summary": "Allows to use server environment with fs storage", + "version": "16.0.1.0.0", + "category": "FS Storage", + "website": "https://github.com/OCA/storage", + "author": " ACSONE SA/NV, Dixmit, Odoo Community Association (OCA)", + "license": "LGPL-3", + "development_status": "Beta", + "installable": True, + "depends": ["fs_storage", "server_environment"], + "data": [], +} diff --git a/fs_storage_environment/models/__init__.py b/fs_storage_environment/models/__init__.py new file mode 100644 index 0000000000..349bb0495a --- /dev/null +++ b/fs_storage_environment/models/__init__.py @@ -0,0 +1 @@ +from . import fs_storage diff --git a/fs_storage_environment/models/fs_storage.py b/fs_storage_environment/models/fs_storage.py new file mode 100644 index 0000000000..e0cea72567 --- /dev/null +++ b/fs_storage_environment/models/fs_storage.py @@ -0,0 +1,26 @@ +# Copyright 2023 ACSONE SA/NV (https://www.acsone.eu). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +from __future__ import annotations + +import logging + +from odoo import models + +_logger = logging.getLogger(__name__) + + +class FSStorage(models.Model): + _name = "fs.storage" + _inherit = ["fs.storage", "server.env.mixin"] + + _server_env_section_name_field = "code" + + @property + def _server_env_fields(self): + return { + "protocol": {}, + "options": {}, + "directory_path": {}, + "eval_options_from_env": {}, + "check_connection_method": {}, + } diff --git a/fs_storage_environment/readme/CONTRIBUTORS.rst b/fs_storage_environment/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..33b59e282e --- /dev/null +++ b/fs_storage_environment/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Laurent Mignon +* Sébastien BEAU +* Enric Tobella \ No newline at end of file diff --git a/fs_storage_environment/readme/DESCRIPTION.rst b/fs_storage_environment/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..7ddd16d7db --- /dev/null +++ b/fs_storage_environment/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to use server environment with fs storage. It is a bridge between fs_storage and server_environment modules. It provides an implementation of the StorageEnvironment class that uses the filesystem as a storage backend. diff --git a/fs_storage_environment/readme/USAGE.rst b/fs_storage_environment/readme/USAGE.rst new file mode 100644 index 0000000000..fc030ecbf8 --- /dev/null +++ b/fs_storage_environment/readme/USAGE.rst @@ -0,0 +1,46 @@ +To ease the management of the filesystem storages configuration accross the different +environments, the configuration of the filesystem storages can be defined in +environment files or directly in the main configuration file. For example, the +configuration of a filesystem storage with the code `fsprod` can be provided in the +main configuration file as follows: + +.. code-block:: ini + + [fs_storage.fsprod] + protocol=s3 + options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"} + directory_path=my_bucket + +To work, a `storage.backend` record must exist with the code `fsprod` into the database. +In your configuration section, you can specify the value for the following fields: + +* `protocol` +* `options` +* `directory_path` + +When evaluating directory_path, `{db_name}` is replaced by the database name. +This is usefull in multi-tenant with a setup completly controlled by +configuration files. + +Migration from storage_backend +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The fs_storage addon can be used to replace the storage_backend addon. (It has +been designed to be a drop-in replacement for the storage_backend addon). To +ease the migration, the `fs.storage` model defines the high-level methods +available in the storage_backend model. These methods are: + +* `add` +* `get` +* `list_files` +* `find_files` +* `move_files` +* `delete` + +These methods are wrappers around the methods of the `fsspec.AbstractFileSystem` +class (see https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem). +These methods are marked as deprecated and will be removed in a future version (V18) +of the addon. You should use the methods of the `fsspec.AbstractFileSystem` class +instead since they are more flexible and powerful. You can access the instance +of the `fsspec.AbstractFileSystem` class using the `fs` property of a `fs.storage` +record. diff --git a/fs_storage_environment/readme/newsfragments/.gitignore b/fs_storage_environment/readme/newsfragments/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fs_storage_environment/static/description/icon.png b/fs_storage_environment/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/fs_storage_environment/static/description/icon.png differ diff --git a/fs_storage_environment/static/description/index.html b/fs_storage_environment/static/description/index.html new file mode 100644 index 0000000000..491f376ea4 --- /dev/null +++ b/fs_storage_environment/static/description/index.html @@ -0,0 +1,482 @@ + + + + + +README.rst + + + +
    + + + +Odoo Community Association + +
    +

    Filesystem Storage Backend

    + +

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

    +

    This module allows to use server environment with fs storage. It is a bridge between fs_storage and server_environment modules. It provides an implementation of the StorageEnvironment class that uses the filesystem as a storage backend.

    +

    Table of contents

    + +
    +

    Usage

    +

    To ease the management of the filesystem storages configuration accross the different +environments, the configuration of the filesystem storages can be defined in +environment files or directly in the main configuration file. For example, the +configuration of a filesystem storage with the code fsprod can be provided in the +main configuration file as follows:

    +
    +[fs_storage.fsprod]
    +protocol=s3
    +options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"}
    +directory_path=my_bucket
    +
    +

    To work, a storage.backend record must exist with the code fsprod into the database. +In your configuration section, you can specify the value for the following fields:

    +
      +
    • protocol
    • +
    • options
    • +
    • directory_path
    • +
    +

    When evaluating directory_path, {db_name} is replaced by the database name. +This is usefull in multi-tenant with a setup completly controlled by +configuration files.

    +
    +

    Migration from storage_backend

    +

    The fs_storage addon can be used to replace the storage_backend addon. (It has +been designed to be a drop-in replacement for the storage_backend addon). To +ease the migration, the fs.storage model defines the high-level methods +available in the storage_backend model. These methods are:

    +
      +
    • add
    • +
    • get
    • +
    • list_files
    • +
    • find_files
    • +
    • move_files
    • +
    • delete
    • +
    +

    These methods are wrappers around the methods of the fsspec.AbstractFileSystem +class (see https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem). +These methods are marked as deprecated and will be removed in a future version (V18) +of the addon. You should use the methods of the fsspec.AbstractFileSystem class +instead since they are more flexible and powerful. You can access the instance +of the fsspec.AbstractFileSystem class using the fs property of a fs.storage +record.

    +
    +
    +
    +

    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
    • +
    • Dixmit
    • +
    +
    +
    +

    Contributors

    + +
    +
    +

    Maintainers

    +

    This module is maintained by the OCA.

    + +Odoo Community Association + +

    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.

    +

    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.

    +
    +
    +
    +
    + + diff --git a/setup/fs_attachment/setup.py b/setup/fs_attachment/setup.py index 28c57bb640..1b55ff4847 100644 --- a/setup/fs_attachment/setup.py +++ b/setup/fs_attachment/setup.py @@ -3,4 +3,10 @@ setuptools.setup( setup_requires=['setuptools-odoo'], odoo_addon=True, + # The dependency are not strictly required for the module + # to be installed, but they are required to ensure + # compatibility with the initial implemenation of the module + # where the server_environment was a direct dependency of + # the module even if not used by the user. + install_requires=['odoo-addon-fs-attachment-environment'], ) diff --git a/setup/fs_attachment_environment/odoo/addons/fs_attachment_environment b/setup/fs_attachment_environment/odoo/addons/fs_attachment_environment new file mode 120000 index 0000000000..9cd38e506e --- /dev/null +++ b/setup/fs_attachment_environment/odoo/addons/fs_attachment_environment @@ -0,0 +1 @@ +../../../../fs_attachment_environment \ No newline at end of file diff --git a/setup/fs_attachment_environment/setup.py b/setup/fs_attachment_environment/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/fs_attachment_environment/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/fs_attachment_s3/setup.py b/setup/fs_attachment_s3/setup.py index 28c57bb640..6f4e70b88a 100644 --- a/setup/fs_attachment_s3/setup.py +++ b/setup/fs_attachment_s3/setup.py @@ -3,4 +3,10 @@ setuptools.setup( setup_requires=['setuptools-odoo'], odoo_addon=True, + # The dependency are not strictly required for the module + # to be installed, but they are required to ensure + # compatibility with the initial implemenation of the module + # where the server_environment was a direct dependency of + # the module even if not used by the user. + install_requires=['odoo-addon-fs-attachment-s3-environment'], ) diff --git a/setup/fs_attachment_s3_environment/odoo/addons/fs_attachment_s3_environment b/setup/fs_attachment_s3_environment/odoo/addons/fs_attachment_s3_environment new file mode 120000 index 0000000000..f6dd077162 --- /dev/null +++ b/setup/fs_attachment_s3_environment/odoo/addons/fs_attachment_s3_environment @@ -0,0 +1 @@ +../../../../fs_attachment_s3_environment \ No newline at end of file diff --git a/setup/fs_attachment_s3_environment/setup.py b/setup/fs_attachment_s3_environment/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/fs_attachment_s3_environment/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/fs_storage/setup.py b/setup/fs_storage/setup.py index 28c57bb640..0173a6b0f7 100644 --- a/setup/fs_storage/setup.py +++ b/setup/fs_storage/setup.py @@ -3,4 +3,10 @@ setuptools.setup( setup_requires=['setuptools-odoo'], odoo_addon=True, + # The dependency are not strictly required for the module + # to be installed, but they are required to ensure + # compatibility with the initial implemenation of the module + # where the server_environment was a direct dependency of + # the module even if not used by the user. + install_requires=['odoo-addon-fs-storage-environment'], ) diff --git a/setup/fs_storage_backup/setup.py b/setup/fs_storage_backup/setup.py index 28c57bb640..eed9a91826 100644 --- a/setup/fs_storage_backup/setup.py +++ b/setup/fs_storage_backup/setup.py @@ -3,4 +3,10 @@ setuptools.setup( setup_requires=['setuptools-odoo'], odoo_addon=True, + # The dependency are not strictly required for the module + # to be installed, but they are required to ensure + # compatibility with the initial implemenation of the module + # where the server_environment was a direct dependency of + # the module even if not used by the user. + install_requires=['odoo-addon-fs-storage-backup-environment'], ) diff --git a/setup/fs_storage_backup_environment/odoo/addons/fs_storage_backup_environment b/setup/fs_storage_backup_environment/odoo/addons/fs_storage_backup_environment new file mode 120000 index 0000000000..82788611d5 --- /dev/null +++ b/setup/fs_storage_backup_environment/odoo/addons/fs_storage_backup_environment @@ -0,0 +1 @@ +../../../../fs_storage_backup_environment \ No newline at end of file diff --git a/setup/fs_storage_backup_environment/setup.py b/setup/fs_storage_backup_environment/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/fs_storage_backup_environment/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/fs_storage_environment/odoo/addons/fs_storage_environment b/setup/fs_storage_environment/odoo/addons/fs_storage_environment new file mode 120000 index 0000000000..c8d5a776e4 --- /dev/null +++ b/setup/fs_storage_environment/odoo/addons/fs_storage_environment @@ -0,0 +1 @@ +../../../../fs_storage_environment \ No newline at end of file diff --git a/setup/fs_storage_environment/setup.py b/setup/fs_storage_environment/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/fs_storage_environment/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)