From acbd566debf3ee0ae2940aa778e5730b91a0e335 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Mon, 8 Dec 2025 14:09:52 +0100 Subject: [PATCH 1/4] Upgrade pylint rule definitions --- .copier-answers.yml | 2 +- .pylintrc | 32 -------------------------------- .pylintrc-mandatory | 32 -------------------------------- 3 files changed, 1 insertion(+), 65 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index a406cf7de8..f63257825c 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.34 +_commit: v1.35 _src_path: git+https://github.com/OCA/oca-addons-repo-template additional_ruff_rules: [] ci: GitHub diff --git a/.pylintrc b/.pylintrc index 16996cb36f..f3d017a8f5 100644 --- a/.pylintrc +++ b/.pylintrc @@ -23,21 +23,12 @@ disable=all # config as a blocking check. enable=anomalous-backslash-in-string, - api-one-deprecated, - api-one-multi-together, assignment-from-none, attribute-deprecated, - class-camelcase, dangerous-default-value, - dangerous-view-replace-wo-priority, development-status-allowed, - duplicate-id-csv, duplicate-key, - duplicate-xml-fields, - duplicate-xml-record-id, - eval-referenced, eval-used, - incoherent-interpreter-exec-perm, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -48,56 +39,33 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, attribute-string-redundant, - character-not-valid-in-resource-link, consider-merging-classes-inherited, context-overridden, - create-user-wo-reset-password, - dangerous-filter-wo-user, - dangerous-qweb-replace-wo-priority, - deprecated-data-xml-node, - deprecated-openerp-xml-node, - duplicate-po-message-definition, except-pass, - file-not-used, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout, bad-builtin-groupby, category-allowed, diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index dc9b71ed30..80567de1e7 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -15,21 +15,12 @@ valid-odoo-versions=19.0 disable=all enable=anomalous-backslash-in-string, - api-one-deprecated, - api-one-multi-together, assignment-from-none, attribute-deprecated, - class-camelcase, dangerous-default-value, - dangerous-view-replace-wo-priority, development-status-allowed, - duplicate-id-csv, duplicate-key, - duplicate-xml-fields, - duplicate-xml-record-id, - eval-referenced, eval-used, - incoherent-interpreter-exec-perm, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -40,56 +31,33 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, attribute-string-redundant, - character-not-valid-in-resource-link, consider-merging-classes-inherited, context-overridden, - create-user-wo-reset-password, - dangerous-filter-wo-user, - dangerous-qweb-replace-wo-priority, - deprecated-data-xml-node, - deprecated-openerp-xml-node, - duplicate-po-message-definition, except-pass, - file-not-used, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout, bad-builtin-groupby, category-allowed, From 6ce96047e0977bc5a444183f92dab760be2ea702 Mon Sep 17 00:00:00 2001 From: cyrilmanuel Date: Wed, 8 Oct 2025 15:16:58 +0200 Subject: [PATCH 2/4] [19.0][MIG] fs_storage Migration 19.0 --- .pre-commit-config.yaml | 1 - fs_storage/README.rst | 10 +++--- fs_storage/__manifest__.py | 4 +-- fs_storage/models/fs_storage.py | 39 ++++++++++++------------ fs_storage/static/description/index.html | 21 +++++-------- fs_storage/tests/test_fs_storage.py | 7 ++++- requirements.txt | 8 ----- 7 files changed, 40 insertions(+), 50 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f737dac10a..bc2df15a45 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,6 @@ exclude: | ^fs_folder_demo/| ^fs_folder_ms_drive/| ^fs_image/| - ^fs_storage/| ^fs_storage_ms_drive/| ^image_tag/| ^microsoft_drive_account/| diff --git a/fs_storage/README.rst b/fs_storage/README.rst index 95bbcb6801..f319eacdac 100644 --- a/fs_storage/README.rst +++ b/fs_storage/README.rst @@ -21,13 +21,13 @@ Filesystem Storage Backend :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/18.0/fs_storage + :target: https://github.com/OCA/storage/tree/19.0/fs_storage :alt: OCA/storage .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/storage-18-0/storage-18-0-fs_storage + :target: https://translation.odoo-community.org/projects/storage-19-0/storage-19-0-fs_storage :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/storage&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/storage&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -287,7 +287,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -319,6 +319,6 @@ 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. +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/__manifest__.py b/fs_storage/__manifest__.py index 401e5748eb..d01e6dcb68 100644 --- a/fs_storage/__manifest__.py +++ b/fs_storage/__manifest__.py @@ -5,13 +5,12 @@ { "name": "Filesystem Storage Backend", "summary": "Implement the concept of Storage with amazon S3, sftp...", - "version": "18.0.2.0.1", + "version": "19.0.1.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": False, "depends": ["base", "base_sparse_field", "server_environment"], "data": [ "views/fs_storage_view.xml", @@ -20,4 +19,5 @@ ], "demo": ["demo/fs_storage_demo.xml"], "external_dependencies": {"python": ["fsspec>=2024.5.0"]}, + "installable": True, } diff --git a/fs_storage/models/fs_storage.py b/fs_storage/models/fs_storage.py index 14941c540b..1b51b31f02 100644 --- a/fs_storage/models/fs_storage.py +++ b/fs_storage/models/fs_storage.py @@ -14,7 +14,7 @@ import fsspec -from odoo import _, api, fields, models, tools +from odoo import api, fields, models, tools from odoo.exceptions import ValidationError from odoo.addons.base_sparse_field.models.fields import Serialized @@ -189,13 +189,10 @@ def __init__(self, env, ids=(), prefetch_ids=()): "* List File : List all files from root directory", ) - _sql_constraints = [ - ( - "code_uniq", - "unique(code)", - "The code must be unique", - ), - ] + _uniq_code = models.Constraint( + "unique(code)", + "The code must be unique", + ) _server_env_section_name_field = "code" @@ -210,7 +207,7 @@ def _check_model_xmlid_storage_unique(self): xmlids = rec.model_xmlids.split(",") for xmlid in xmlids: other_storages = ( - self.env["fs.storage"] + self.env["fs.storage"] # pylint: disable=no-search-all .search([]) .filtered_domain( [ @@ -221,7 +218,7 @@ def _check_model_xmlid_storage_unique(self): ) if other_storages: raise ValidationError( - _( + self.env._( "Model %(model)s already stored in another " "FS storage ('%(other_storage)s')" ) @@ -239,7 +236,7 @@ def _check_field_xmlid_storage_unique(self): xmlids = rec.field_xmlids.split(",") for xmlid in xmlids: other_storages = ( - self.env["fs.storage"] + self.env["fs.storage"] # pylint: disable=no-search-all .search([]) .filtered_domain( [ @@ -250,7 +247,7 @@ def _check_field_xmlid_storage_unique(self): ) if other_storages: raise ValidationError( - _( + self.env._( "Field %(field)s already stored in another " "FS storage ('%(other_storage)s')" ) @@ -260,8 +257,8 @@ def _check_field_xmlid_storage_unique(self): @api.model def _get_check_connection_method_selection(self): return [ - ("marker_file", _("Create Marker file")), - ("ls", _("List File")), + ("marker_file", self.env._("Create Marker file")), + ("ls", self.env._("List File")), ] @property @@ -338,7 +335,7 @@ def get_storage_code_by_model_field(self, model_name, field_name=None): ) if field: storage = ( - self.env["fs.storage"] + self.env["fs.storage"] # pylint: disable=no-search-all .sudo() .search([]) .filtered_domain([("field_ids", "in", [field.id])]) @@ -353,7 +350,7 @@ def get_storage_code_by_model_field(self, model_name, field_name=None): ) if model: storage = ( - self.env["fs.storage"] + self.env["fs.storage"] # pylint: disable=no-search-all .sudo() .search([]) .filtered_domain([("model_ids", "in", [model.id])]) @@ -399,7 +396,9 @@ def _check_options(self) -> None: try: json.loads(rec.options or "{}") except Exception as e: - raise ValidationError(_("The options must be a valid JSON")) from e + raise ValidationError( + self.env._("The options must be a valid JSON") + ) from e @api.depends("options") def _compute_json_options(self) -> None: @@ -703,11 +702,11 @@ def action_test_config(self): def _test_config(self, connection_method): try: self._check_connection(self.fs, connection_method) - title = _("Connection Test Succeeded!") - message = _("Everything seems properly set up!") + title = self.env._("Connection Test Succeeded!") + message = self.env._("Everything seems properly set up!") msg_type = "success" except Exception as err: - title = _("Connection Test Failed!") + title = self.env._("Connection Test Failed!") message = str(err) msg_type = "danger" return { diff --git a/fs_storage/static/description/index.html b/fs_storage/static/description/index.html index 13eba13760..420b47cca8 100644 --- a/fs_storage/static/description/index.html +++ b/fs_storage/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -363,9 +362,7 @@
- -Odoo Community Association - +Odoo Community Association

Filesystem Storage Backend

-

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

This addon is a technical addon that allows you to define filesystem like storage for your data. It’s used by other addons to store their data in a transparent way into different kind of storages.

@@ -644,7 +641,7 @@

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.

+feedback.

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

@@ -666,13 +663,11 @@

Contributors

Maintainers

This module is maintained by the OCA.

- -Odoo Community Association - +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.

+

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/tests/test_fs_storage.py b/fs_storage/tests/test_fs_storage.py index 3d23512a4c..a6e554bc18 100644 --- a/fs_storage/tests/test_fs_storage.py +++ b/fs_storage/tests/test_fs_storage.py @@ -82,7 +82,12 @@ def test_ensure_one_fs_by_record(self): for i in range(4): backend_ids.append( self.backend.create( - {"name": f"name{i}", "directory_path": f"{i}", "code": f"code{i}"} + { + "name": f"name{i}", + "directory_path": f"{i}", + "code": f"code{i}", + "protocol": "odoofs", + } ).id ) records = self.backend.browse(backend_ids) diff --git a/requirements.txt b/requirements.txt index aeccb5304f..0905f9449e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,2 @@ # generated from manifests external_dependencies -boto3 fsspec>=2024.5.0 -fsspec>=2025.0.0 -fsspec>=2025.3.0 -fsspec[s3] -msgraphfs -paramiko -pyftpdlib -python_slugify From a3d2729d08c5eb024308e6e9b2ee4d3a25d5394e Mon Sep 17 00:00:00 2001 From: jcoux Date: Fri, 28 Nov 2025 10:36:00 +0100 Subject: [PATCH 3/4] [19.0][MIG] fs_storage: Adapt tests to run without demo data --- fs_storage/README.rst | 1 + fs_storage/__manifest__.py | 1 - fs_storage/demo/fs_storage_demo.xml | 8 -------- fs_storage/readme/CONTRIBUTORS.md | 1 + fs_storage/static/description/index.html | 16 +++++++++++----- fs_storage/tests/common.py | 24 ++++++++++++++++++++++-- fs_storage/tests/test_fs_storage.py | 1 - 7 files changed, 35 insertions(+), 17 deletions(-) delete mode 100644 fs_storage/demo/fs_storage_demo.xml diff --git a/fs_storage/README.rst b/fs_storage/README.rst index f319eacdac..35ebd9f687 100644 --- a/fs_storage/README.rst +++ b/fs_storage/README.rst @@ -305,6 +305,7 @@ Contributors - Laurent Mignon - Sébastien BEAU - Marie Lejeune +- Julien Coux Maintainers ----------- diff --git a/fs_storage/__manifest__.py b/fs_storage/__manifest__.py index d01e6dcb68..d6bb9bf5f4 100644 --- a/fs_storage/__manifest__.py +++ b/fs_storage/__manifest__.py @@ -17,7 +17,6 @@ "security/ir.model.access.csv", "wizards/fs_test_connection.xml", ], - "demo": ["demo/fs_storage_demo.xml"], "external_dependencies": {"python": ["fsspec>=2024.5.0"]}, "installable": True, } diff --git a/fs_storage/demo/fs_storage_demo.xml b/fs_storage/demo/fs_storage_demo.xml deleted file mode 100644 index 0917d06221..0000000000 --- a/fs_storage/demo/fs_storage_demo.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Odoo Filesystem Backend - odoofs - odoofs - - diff --git a/fs_storage/readme/CONTRIBUTORS.md b/fs_storage/readme/CONTRIBUTORS.md index 139cad9973..0ec48212d3 100644 --- a/fs_storage/readme/CONTRIBUTORS.md +++ b/fs_storage/readme/CONTRIBUTORS.md @@ -1,3 +1,4 @@ - Laurent Mignon \<\> - Sébastien BEAU \<\> - Marie Lejeune \<\> +- Julien Coux \<\> diff --git a/fs_storage/static/description/index.html b/fs_storage/static/description/index.html index 420b47cca8..d72205ab97 100644 --- a/fs_storage/static/description/index.html +++ b/fs_storage/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -362,7 +363,9 @@
-Odoo Community Association + +Odoo Community Association +

Filesystem Storage Backend