Skip to content

Commit 0cfb599

Browse files
committed
[ADD] storage_backend_environment: make server_environment an optional dependency
1 parent da51a09 commit 0cfb599

11 files changed

Lines changed: 586 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../storage_backend_environment
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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 - Server Environment
7+
====================================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:e06faaef8e877cb770756ffc80fe1426d83d0130f6f1c239e9f16995156676ed
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Production/Stable
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
22+
:alt: License: LGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github
24+
:target: https://github.com/OCA/storage/tree/16.0/storage_backend_environment
25+
:alt: OCA/storage
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-storage_backend_environment
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/storage&target_branch=16.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
Glue module to make Server Environment features available for the storage backend addon.
36+
37+
**Table of contents**
38+
39+
.. contents::
40+
:local:
41+
42+
Bug Tracker
43+
===========
44+
45+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/storage/issues>`_.
46+
In case of trouble, please check there if your issue has already been reported.
47+
If you spotted it first, help us to smash it by providing a detailed and welcomed
48+
`feedback <https://github.com/OCA/storage/issues/new?body=module:%20storage_backend_environment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
49+
50+
Do not contact contributors directly about support or help with technical issues.
51+
52+
Credits
53+
=======
54+
55+
Authors
56+
~~~~~~~
57+
58+
* Akretion
59+
60+
Contributors
61+
~~~~~~~~~~~~
62+
63+
* Sébastien BEAU <sebastien.beau@akretion.com>
64+
* Raphaël Reverdy <raphael.reverdy@akretion.com>
65+
* Florian da Costa <florian.dacosta@akretion.com>
66+
* Cédric Pigeon <cedric.pigeon@acsone.eu>
67+
* Renato Lima <renato.lima@akretion.com>
68+
* Benoît Guillot <benoit.guillot@akretion.com>
69+
* Laurent Mignon <laurent.mignon@acsone.eu>
70+
* Denis Roussel <denis.roussel@acsone.eu>
71+
* Maksym Yankin <maksym.yankin@camptocamp.com>
72+
73+
Maintainers
74+
~~~~~~~~~~~
75+
76+
This module is maintained by the OCA.
77+
78+
.. image:: https://odoo-community.org/logo.png
79+
:alt: Odoo Community Association
80+
:target: https://odoo-community.org
81+
82+
OCA, or the Odoo Community Association, is a nonprofit organization whose
83+
mission is to support the collaborative development of Odoo features and
84+
promote its widespread use.
85+
86+
This module is part of the `OCA/storage <https://github.com/OCA/storage/tree/16.0/storage_backend_environment>`_ project on GitHub.
87+
88+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2017 Akretion (http://www.akretion.com).
2+
# @author Sébastien BEAU <sebastien.beau@akretion.com>
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
4+
5+
{
6+
"name": "Storage Backend - Server Environment",
7+
"summary": "Use Server Environment feature to manage storage backends",
8+
"version": "16.0.1.0.0",
9+
"category": "Storage",
10+
"website": "https://github.com/OCA/storage",
11+
"author": " Akretion, Odoo Community Association (OCA)",
12+
"license": "LGPL-3",
13+
"development_status": "Production/Stable",
14+
"installable": True,
15+
"depends": ["storage_backend", "server_environment"],
16+
"auto_install": True,
17+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import storage_backend
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2017 Akretion (http://www.akretion.com).
2+
# @author Sébastien BEAU <sebastien.beau@akretion.com>
3+
# Copyright 2019 Camptocamp SA (http://www.camptocamp.com).
4+
# @author Simone Orsi <simone.orsi@camptocamp.com>
5+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
6+
7+
from odoo import models
8+
9+
10+
class StorageBackend(models.Model):
11+
_name = "storage.backend"
12+
_inherit = ["storage.backend", "server.env.mixin"]
13+
14+
def _compute_has_validation(self):
15+
# with server_env
16+
# this code can be triggered
17+
# before a backend_type has been set
18+
# get_adapter() can't work without backend_type
19+
no_type_storage = self.filtered(lambda storage: not storage.backend_type)
20+
no_type_storage.has_validation = False
21+
return super(StorageBackend, self - no_type_storage)._compute_has_validation()
22+
23+
@property
24+
def _server_env_fields(self):
25+
return {"backend_type": {}, "directory_path": {}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* Sébastien BEAU <sebastien.beau@akretion.com>
2+
* Raphaël Reverdy <raphael.reverdy@akretion.com>
3+
* Florian da Costa <florian.dacosta@akretion.com>
4+
* Cédric Pigeon <cedric.pigeon@acsone.eu>
5+
* Renato Lima <renato.lima@akretion.com>
6+
* Benoît Guillot <benoit.guillot@akretion.com>
7+
* Laurent Mignon <laurent.mignon@acsone.eu>
8+
* Denis Roussel <denis.roussel@acsone.eu>
9+
* Maksym Yankin <maksym.yankin@camptocamp.com>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Glue module to make Server Environment features available for the storage backend addon.
9.23 KB
Loading

0 commit comments

Comments
 (0)