Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4c7ce56
[IMP] fs_storage: Remove environment data
etobella Jun 3, 2026
8ab22a7
[ADD] fs_storage_environment
etobella Jun 3, 2026
02f0301
[IMP] fs_storage_environment: preserve data on install and restore co…
yankinmax Aug 19, 2026
6aeb992
[IMP] fs_attachment: Remove environment data
etobella Jun 3, 2026
763dfd9
[ADD] fs_attachment_environment
etobella Jun 3, 2026
cb31e0a
[FIX] fs_attachment: Add migration script for server_environment split
lmignon Jun 4, 2026
c28f6cd
[IMP] fs_attachment_environment: preserve data on install and restore…
yankinmax Aug 19, 2026
3a4de3b
[IMP] fs_attachment_s3: Remove environment data
etobella Jun 3, 2026
a38ce73
[ADD] fs_attachment_s3_environemnt
etobella Jun 3, 2026
8076c14
[FIX] fs_attachment_s3: Add migration script for server_environment s…
lmignon Jun 4, 2026
2c4a1a1
[IMP] fs_attachment_s3_environment: preserve data on install and rest…
yankinmax Aug 19, 2026
070f0f6
[IMP] storage_backend: Remove environment data
yankinmax Aug 20, 2026
33cb051
[ADD] storage_backend_environment
yankinmax Aug 20, 2026
6ee15eb
[IMP] storage_backend_environment: preserve data on install and resto…
yankinmax Aug 20, 2026
cd48d8e
[IMP] storage_backend_sftp: Remove environment data
yankinmax Aug 20, 2026
989eb62
[ADD] storage_backend_sftp_environment
yankinmax Aug 20, 2026
c5c4c25
[FIX] storage_backend_sftp: Add migration script for server_environme…
yankinmax Aug 20, 2026
ca9cde7
[IMP] storage_backend_sftp_environment: preserve data on install and …
yankinmax Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions fs_attachment/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============================
Base Attachment Object Store
============================
Expand All @@ -17,7 +13,7 @@ Base Attachment Object Store
.. |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
.. |badge2| image:: https://img.shields.io/badge/licence-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
Expand Down
2 changes: 1 addition & 1 deletion fs_attachment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Base Attachment Object Store",
"summary": "Store attachments on external object store",
"version": "17.0.1.6.3",
"version": "17.0.1.6.4",
"author": "Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"development_status": "Beta",
Expand Down
19 changes: 0 additions & 19 deletions fs_attachment/models/fs_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,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}'
Expand Down
56 changes: 25 additions & 31 deletions fs_attachment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Base Attachment Object Store</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="base-attachment-object-store">
<h1 class="title">Base Attachment Object Store</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="base-attachment-object-store">
<h1>Base Attachment Object Store</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8c9ea21e76a948d543936d567f2b8f23f236f520cb2c01d9bb1150cd10d62e3a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/storage/tree/17.0/fs_attachment"><img alt="OCA/storage" src="https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_attachment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/storage&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/storage/tree/17.0/fs_attachment"><img alt="OCA/storage" src="https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_attachment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/storage&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>In some cases, you need to store attachment in another system that the
Odoo’s filestore. For example, when your deployment is based on a
multi-server architecture to ensure redundancy and scalability, your
Expand Down Expand Up @@ -453,9 +448,9 @@ <h1>Base Attachment Object Store</h1>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<div class="section" id="configuration">
<h3><a class="toc-backref" href="#toc-entry-2">Configuration</a></h3>
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
<p>The configuration is done through the creation of a filesytem storage
record into odoo. To create a new storage, go to the menu
<tt class="docutils literal">Settings &gt; Technical &gt; FS Storage</tt> and click on <tt class="docutils literal">Create</tt>.</p>
Expand Down Expand Up @@ -597,7 +592,7 @@ <h3><a class="toc-backref" href="#toc-entry-2">Configuration</a></h3>
</ul>
</div>
<div class="section" id="server-environment">
<h3><a class="toc-backref" href="#toc-entry-3">Server Environment</a></h3>
<h2><a class="toc-backref" href="#toc-entry-3">Server Environment</a></h2>
<p>When you configure a storage through the use of server environment file,
you can provide values for the following keys:</p>
<ul class="simple">
Expand Down Expand Up @@ -626,7 +621,7 @@ <h3><a class="toc-backref" href="#toc-entry-3">Server Environment</a></h3>
</pre>
</div>
<div class="section" id="advanced-usage-using-attachment-as-a-file">
<h3><a class="toc-backref" href="#toc-entry-4">Advanced usage: Using attachment as a file</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Advanced usage: Using attachment as a file</a></h2>
<p>The open method on the attachment can be used to open manipulate the
attachment as a file object. The object returned by the call to the
method implements methods from <tt class="docutils literal">io.IOBase</tt>. The method can ba called
Expand Down Expand Up @@ -666,7 +661,7 @@ <h3><a class="toc-backref" href="#toc-entry-4">Advanced usage: Using attachment
</pre>
</div>
<div class="section" id="tips-tricks">
<h3><a class="toc-backref" href="#toc-entry-5">Tips &amp; Tricks</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Tips &amp; Tricks</a></h2>
<ul>
<li><p class="first">When working in multi staging environments, the management of the
attachments can be tricky. For example, if you have a production
Expand Down Expand Up @@ -696,21 +691,21 @@ <h3><a class="toc-backref" href="#toc-entry-5">Tips &amp; Tricks</a></h3>
</div>
</div>
<div class="section" id="changelog">
<h2><a class="toc-backref" href="#toc-entry-6">Changelog</a></h2>
<h1><a class="toc-backref" href="#toc-entry-6">Changelog</a></h1>
<div class="section" id="section-1">
<h3><a class="toc-backref" href="#toc-entry-7">17.0.1.6.0 (2025-10-22)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-7">17.0.1.6.0 (2025-10-22)</a></h2>
<div class="section" id="features">
<h4><a class="toc-backref" href="#toc-entry-8">Features</a></h4>
<h3><a class="toc-backref" href="#toc-entry-8">Features</a></h3>
<ul class="simple">
<li>Adapt to handle {db_name} in directory_path.
(<a class="reference external" href="https://github.com/OCA/storage/issues/db_name">#db_name</a>)</li>
</ul>
</div>
</div>
<div class="section" id="section-2">
<h3><a class="toc-backref" href="#toc-entry-9">17.0.1.0.3 (2024-10-15)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-9">17.0.1.0.3 (2024-10-15)</a></h2>
<div class="section" id="bugfixes">
<h4><a class="toc-backref" href="#toc-entry-10">Bugfixes</a></h4>
<h3><a class="toc-backref" href="#toc-entry-10">Bugfixes</a></h3>
<ul>
<li><p class="first">No crash o missign file.</p>
<p>Prior to this change, Odoo was crashing as soon as access to a file
Expand All @@ -724,7 +719,7 @@ <h4><a class="toc-backref" href="#toc-entry-10">Bugfixes</a></h4>
</div>
</div>
<div class="section" id="section-3">
<h3><a class="toc-backref" href="#toc-entry-11">16.0.1.0.8 (2023-12-20)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-11">16.0.1.0.8 (2023-12-20)</a></h2>
<p><strong>Bugfixes</strong></p>
<ul class="simple">
<li>Fix the error retrieving attachment files when the storage is set to
Expand All @@ -733,7 +728,7 @@ <h3><a class="toc-backref" href="#toc-entry-11">16.0.1.0.8 (2023-12-20)</a></h3>
</ul>
</div>
<div class="section" id="section-4">
<h3><a class="toc-backref" href="#toc-entry-12">16.0.1.0.6 (2023-12-02)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-12">16.0.1.0.6 (2023-12-02)</a></h2>
<p><strong>Bugfixes</strong></p>
<ul>
<li><p class="first">Improve performance at creation of an attachment or when the
Expand All @@ -749,7 +744,7 @@ <h3><a class="toc-backref" href="#toc-entry-12">16.0.1.0.6 (2023-12-02)</a></h3>
</ul>
</div>
<div class="section" id="section-5">
<h3><a class="toc-backref" href="#toc-entry-13">16.0.1.0.5 (2023-11-29)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-13">16.0.1.0.5 (2023-11-29)</a></h2>
<p><strong>Bugfixes</strong></p>
<ul class="simple">
<li>When manipulating the file system api through a local variable named
Expand All @@ -761,7 +756,7 @@ <h3><a class="toc-backref" href="#toc-entry-13">16.0.1.0.5 (2023-11-29)</a></h3>
</ul>
</div>
<div class="section" id="section-6">
<h3><a class="toc-backref" href="#toc-entry-14">16.0.1.0.4 (2023-11-22)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-14">16.0.1.0.4 (2023-11-22)</a></h2>
<p><strong>Bugfixes</strong></p>
<ul class="simple">
<li>Fix error when an url is computed for an attachment in a storage
Expand All @@ -770,7 +765,7 @@ <h3><a class="toc-backref" href="#toc-entry-14">16.0.1.0.4 (2023-11-22)</a></h3>
</ul>
</div>
<div class="section" id="section-7">
<h3><a class="toc-backref" href="#toc-entry-15">16.0.1.0.3 (2023-10-17)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-15">16.0.1.0.3 (2023-10-17)</a></h2>
<p><strong>Bugfixes</strong></p>
<ul class="simple">
<li>Fix access to technical models to be able to upload attachments for
Expand All @@ -779,7 +774,7 @@ <h3><a class="toc-backref" href="#toc-entry-15">16.0.1.0.3 (2023-10-17)</a></h3>
</ul>
</div>
<div class="section" id="section-8">
<h3><a class="toc-backref" href="#toc-entry-16">16.0.1.0.2 (2023-10-09)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-16">16.0.1.0.2 (2023-10-09)</a></h2>
<p><strong>Bugfixes</strong></p>
<ul class="simple">
<li>Ensures python 3.9 compatibility.
Expand All @@ -792,24 +787,24 @@ <h3><a class="toc-backref" href="#toc-entry-16">16.0.1.0.2 (2023-10-09)</a></h3>
</div>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-17">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-17">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/storage/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/storage/issues/new?body=module:%20fs_attachment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-18">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-18">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-19">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-19">Authors</a></h2>
<ul class="simple">
<li>Camptocamp</li>
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-20">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-20">Contributors</a></h2>
<ul class="simple">
<li>Thierry Ducrest &lt;<a class="reference external" href="mailto:thierry.ducrest&#64;camptocamp.com">thierry.ducrest&#64;camptocamp.com</a>&gt;</li>
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
Expand All @@ -829,7 +824,7 @@ <h3><a class="toc-backref" href="#toc-entry-20">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-21">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-21">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -844,6 +839,5 @@ <h3><a class="toc-backref" href="#toc-entry-21">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions fs_attachment/tests/test_fs_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,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,
}
Expand Down
21 changes: 21 additions & 0 deletions fs_attachment/upgrades/17.0.1.6.4/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from openupgradelib import openupgrade

from odoo import _, exceptions


@openupgrade.migrate()
def migrate(env, version):
module = env["ir.module.module"].search(
[("name", "=", "fs_attachment_environment")]
)
if not module:
raise exceptions.UserError(
_(
"The 'fs_attachment_environment' module is not available. "
"It is required to preserve the server environment managed "
"fields of 'fs.storage'. Make it available on the "
"addons path before upgrading 'fs_attachment'."
)
)
if module.state == "uninstalled":
module.button_install()
79 changes: 79 additions & 0 deletions fs_attachment_environment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
=============================
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/licence-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/17.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-17-0/storage-17-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=17.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 <https://github.com/OCA/storage/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 <https://github.com/OCA/storage/issues/new?body=module:%20fs_attachment_environment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ACSONE SA/NV
* Dixmit

Contributors
------------

- Laurent Mignon <laurent.mignon@acsone.eu>
- Sébastien BEAU <sebastien.beau@akretion.com>
- 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 <https://github.com/OCA/storage/tree/17.0/fs_attachment_environment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions fs_attachment_environment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook, uninstall_hook
17 changes: 17 additions & 0 deletions fs_attachment_environment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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": "17.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"],
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
}
Loading
Loading