Skip to content

Commit da51a09

Browse files
committed
[REF] storage_backend: server_environment should not be a required dependency
1 parent 4d047fa commit da51a09

5 files changed

Lines changed: 51 additions & 27 deletions

File tree

storage_backend/README.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
==============
2-
Storage Bakend
3-
==============
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
===============
6+
Storage Backend
7+
===============
48

59
..
610
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -13,7 +17,7 @@ Storage Bakend
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Production/Stable
16-
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1822
:alt: License: LGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github
@@ -28,6 +32,15 @@ Storage Bakend
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
3034

35+
This module defines a reusable storage backend model for Odoo.
36+
37+
It serves as a base layer for modules that need to connect Odoo with external
38+
file storage systems. A backend record centralizes storage configuration and
39+
allows specialized addons to implement support for concrete protocols or
40+
providers such as Amazon S3, SFTP, or compatible services.
41+
42+
This addon is mainly a technical dependency used by other storage-related
43+
modules.
3144

3245
**Table of contents**
3346

storage_backend/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44

55
{
6-
"name": "Storage Bakend",
6+
"name": "Storage Backend",
77
"summary": "Implement the concept of Storage with amazon S3, sftp...",
88
"version": "16.0.1.1.0",
99
"category": "Storage",
@@ -12,7 +12,7 @@
1212
"license": "LGPL-3",
1313
"development_status": "Production/Stable",
1414
"installable": True,
15-
"depends": ["base", "component", "server_environment"],
15+
"depends": ["base", "component"],
1616
"data": [
1717
"views/backend_storage_view.xml",
1818
"data/data.xml",

storage_backend/models/storage_backend.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def new_func1(*args, **kwargs):
5656

5757
class StorageBackend(models.Model):
5858
_name = "storage.backend"
59-
_inherit = ["collection.base", "server.env.mixin"]
59+
_inherit = "collection.base"
6060
_backend_name = "storage_backend"
6161
_description = "Storage Backend"
6262

@@ -71,20 +71,9 @@ class StorageBackend(models.Model):
7171

7272
def _compute_has_validation(self):
7373
for rec in self:
74-
if not rec.backend_type:
75-
# with server_env
76-
# this code can be triggered
77-
# before a backend_type has been set
78-
# get_adapter() can't work without backend_type
79-
rec.has_validation = False
80-
continue
8174
adapter = rec._get_adapter()
8275
rec.has_validation = hasattr(adapter, "validate_config")
8376

84-
@property
85-
def _server_env_fields(self):
86-
return {"backend_type": {}, "directory_path": {}}
87-
8877
def add(self, relative_path, data, binary=True, **kwargs):
8978
if not binary:
9079
data = base64.b64decode(data)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
This module defines a reusable storage backend model for Odoo.
2+
3+
It serves as a base layer for modules that need to connect Odoo with external
4+
file storage systems. A backend record centralizes storage configuration and
5+
allows specialized addons to implement support for concrete protocols or
6+
providers such as Amazon S3, SFTP, or compatible services.
7+
8+
This addon is mainly a technical dependency used by other storage-related
9+
modules.

storage_backend/static/description/index.html

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Storage Bakend</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,28 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="storage-bakend">
364-
<h1 class="title">Storage Bakend</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="storage-backend">
370+
<h1>Storage Backend</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:e06faaef8e877cb770756ffc80fe1426d83d0130f6f1c239e9f16995156676ed
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/storage/tree/16.0/storage_backend"><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-16-0/storage-16-0-storage_backend"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/storage/tree/16.0/storage_backend"><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-16-0/storage-16-0-storage_backend"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378+
<p>This module defines a reusable storage backend model for Odoo.</p>
379+
<p>It serves as a base layer for modules that need to connect Odoo with external
380+
file storage systems. A backend record centralizes storage configuration and
381+
allows specialized addons to implement support for concrete protocols or
382+
providers such as Amazon S3, SFTP, or compatible services.</p>
383+
<p>This addon is mainly a technical dependency used by other storage-related
384+
modules.</p>
373385
<p><strong>Table of contents</strong></p>
374386
<div class="contents local topic" id="contents">
375387
<ul class="simple">
@@ -383,23 +395,23 @@ <h1 class="title">Storage Bakend</h1>
383395
</ul>
384396
</div>
385397
<div class="section" id="bug-tracker">
386-
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
398+
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
387399
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/storage/issues">GitHub Issues</a>.
388400
In case of trouble, please check there if your issue has already been reported.
389401
If you spotted it first, help us to smash it by providing a detailed and welcomed
390402
<a class="reference external" href="https://github.com/OCA/storage/issues/new?body=module:%20storage_backend%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
391403
<p>Do not contact contributors directly about support or help with technical issues.</p>
392404
</div>
393405
<div class="section" id="credits">
394-
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
406+
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
395407
<div class="section" id="authors">
396-
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
408+
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
397409
<ul class="simple">
398410
<li>Akretion</li>
399411
</ul>
400412
</div>
401413
<div class="section" id="contributors">
402-
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
414+
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
403415
<ul class="simple">
404416
<li>Sébastien BEAU &lt;<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>&gt;</li>
405417
<li>Raphaël Reverdy &lt;<a class="reference external" href="mailto:raphael.reverdy&#64;akretion.com">raphael.reverdy&#64;akretion.com</a>&gt;</li>
@@ -412,7 +424,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
412424
</ul>
413425
</div>
414426
<div class="section" id="maintainers">
415-
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
427+
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
416428
<p>This module is maintained by the OCA.</p>
417429
<a class="reference external image-reference" href="https://odoo-community.org">
418430
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -425,5 +437,6 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
425437
</div>
426438
</div>
427439
</div>
440+
</div>
428441
</body>
429442
</html>

0 commit comments

Comments
 (0)