-
-
Notifications
You must be signed in to change notification settings - Fork 224
[16.0] [IMP] fs_storage: Remove dependancy on server_environment #627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
51bdcf2
[IMP] fs_storage: Remove dependancy on server_environment
etobella 48bb19d
[ADD] fs_storage_environment
etobella 1910210
[FIX] fs_attachment: Fix tests
etobella 1f4a0bf
[IMP] fs_attachment: Remove environment data
etobella 573987e
[ADD] fs_attachment_environment
etobella 6c5099d
[IMP] fs_attachment_s3: Add attachment S3 module
etobella f476984
[ADD] fs_attachment_s3_environemnt
etobella f03303c
[IMP] fs_storage_backup: Remove environment code
etobella 28b4fcf
[ADD] fs_storage_backup_environment
etobella 734c5ab
[FIX] fs_attachment: Add migration script for server_environment split
lmignon facb7a9
[FIX] fs_attachment_s3: Add migration script for server_environment s…
lmignon 650cf06
[FIX] fs_storage_backup: Add migration script for server_environment …
lmignon cd5cc7e
[FIX] fs_storage: Ensure glue addon availability
lmignon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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' | ||
| """, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <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:%2016.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/16.0/fs_attachment_environment>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": "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, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import fs_storage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| * Laurent Mignon <laurent.mignon@acsone.eu> | ||
| * Sébastien BEAU <sebastien.beau@akretion.com> | ||
| * Enric Tobella |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Glue module for fs_attachment to use fs_storage_environment |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that really enough to get
fs_attachment_environmentinstalled during thefs_attachmentupgrade?I would've bet you need to call
button_installorbutton_immediate_installon their.module.moduleinstead.@yankinmax, you worked on this too, do you remember what you had to do for the other modules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed migration did not run properly for me and erased the field values for the existing "fs.storage" records in the production environment.
Not sure if this was one of the reasons.
I was able to quickly to recover the config from a backup