Skip to content

Commit 718de03

Browse files
committed
fixup! [19.0][MIG] fs_attachment Migration 19.0
1 parent 70cb033 commit 718de03

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

fs_attachment/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Base Attachment Object Store
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github
24-
:target: https://github.com/OCA/storage/tree/18.0/fs_attachment
24+
:target: https://github.com/OCA/storage/tree/19.0/fs_attachment
2525
:alt: OCA/storage
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/storage-18-0/storage-18-0-fs_attachment
27+
:target: https://translation.odoo-community.org/projects/storage-19-0/storage-19-0-fs_attachment
2828
:alt: Translate me on Weblate
2929
.. |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=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/storage&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -422,7 +422,7 @@ Bug Tracker
422422
Bugs are tracked on `GitHub Issues <https://github.com/OCA/storage/issues>`_.
423423
In case of trouble, please check there if your issue has already been reported.
424424
If you spotted it first, help us to smash it by providing a detailed and welcomed
425-
`feedback <https://github.com/OCA/storage/issues/new?body=module:%20fs_attachment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
425+
`feedback <https://github.com/OCA/storage/issues/new?body=module:%20fs_attachment%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
426426

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

@@ -475,6 +475,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
475475

476476
|maintainer-lmignon|
477477

478-
This module is part of the `OCA/storage <https://github.com/OCA/storage/tree/18.0/fs_attachment>`_ project on GitHub.
478+
This module is part of the `OCA/storage <https://github.com/OCA/storage/tree/19.0/fs_attachment>`_ project on GitHub.
479479

480480
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

fs_attachment/models/fs_file_gc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import threading
55
from contextlib import closing, contextmanager
66

7-
from odoo import api, fields, models
7+
from odoo import api, fields, models, modules
88
from odoo.sql_db import Cursor
99

1010
_logger = logging.getLogger(__name__)
@@ -28,7 +28,7 @@ def _is_test_mode(self) -> bool:
2828
"""
2929
return (
3030
getattr(threading.current_thread(), "testing", False)
31-
or self.env.registry.in_test_mode()
31+
or modules.module.current_test
3232
)
3333

3434
@contextmanager
@@ -117,7 +117,7 @@ def _gc_files(self) -> None:
117117
def _gc_files_unsafe(self) -> None:
118118
# get the list of fs.storage codes that must be autovacuumed
119119
codes = (
120-
self.env["fs.storage"].search([]).filtered("autovacuum_gc").mapped("code")
120+
self.env["fs.storage"].search([]).filtered("autovacuum_gc").mapped("code") # pylint: disable=no-search-all
121121
)
122122
if not codes:
123123
return

fs_attachment/models/fs_storage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from __future__ import annotations
55

6-
from odoo import _, api, fields, models, tools
6+
from odoo import api, fields, models, tools
77
from odoo.exceptions import ValidationError
88
from odoo.tools.safe_eval import const_eval
99

@@ -82,7 +82,7 @@ class FsStorage(models.Model):
8282
def _check_use_as_default_for_attachments(self):
8383
# constrains are checked in python since values can be provided by
8484
# the server environment
85-
defaults = self.search([]).filtered("use_as_default_for_attachments")
85+
defaults = self.search([]).filtered("use_as_default_for_attachments") # pylint: disable=no-search-all
8686
if len(defaults) > 1:
8787
raise ValidationError(
8888
self.env._("Only one storage can be used as default for attachments")
@@ -132,7 +132,7 @@ def write(self, vals):
132132
if not vals["use_as_default_for_attachments"]:
133133
vals["force_db_for_default_attachment_rules"] = None
134134
res = super().write(vals)
135-
self.env.create_write_check_constraints(vals)
135+
self.env._create_write_check_constraints(vals)
136136
return res
137137

138138
def _create_write_check_constraints(self, vals):
@@ -184,7 +184,7 @@ def _check_force_db_for_default_attachment_rules(self):
184184
@tools.ormcache()
185185
def get_storage_code_for_attachments_fallback(self):
186186
storages = (
187-
self.sudo()
187+
self.sudo() # pylint: disable=no-search-all
188188
.search([])
189189
.filtered_domain([("use_as_default_for_attachments", "=", True)])
190190
)

fs_attachment/static/description/index.html

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
11+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15-
Despite the name, some widely supported CSS2 features are used.
1615
1716
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1817
customize this style sheet.
@@ -275,7 +274,7 @@
275274
margin-left: 2em ;
276275
margin-right: 2em }
277276

278-
pre.code .ln { color: gray; } /* line numbers */
277+
pre.code .ln { color: grey; } /* line numbers */
279278
pre.code, code { background-color: #eeeeee }
280279
pre.code .comment, code .comment { color: #5C6576 }
281280
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +300,7 @@
301300
span.pre {
302301
white-space: pre }
303302

304-
span.problematic, pre.problematic {
303+
span.problematic {
305304
color: red }
306305

307306
span.section-subtitle {
@@ -363,9 +362,7 @@
363362
<div class="document">
364363

365364

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>
365+
<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>
369366
<div class="section" id="base-attachment-object-store">
370367
<h1>Base Attachment Object Store</h1>
371368
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -374,7 +371,7 @@ <h1>Base Attachment Object Store</h1>
374371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375372
!! source digest: sha256:ce5c43b22c654c05f7c0b6c6b919001cb4a4c77d4031841a7a9acc02a9b2d1e0
376373
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<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/18.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-18-0/storage-18-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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
374+
<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/19.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-19-0/storage-19-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=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378375
<p>In some cases, you need to store attachment in another system that the
379376
Odoo’s filestore. For example, when your deployment is based on a
380377
multi-server architecture to ensure redundancy and scalability, your
@@ -772,7 +769,7 @@ <h2><a class="toc-backref" href="#toc-entry-15">Bug Tracker</a></h2>
772769
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/storage/issues">GitHub Issues</a>.
773770
In case of trouble, please check there if your issue has already been reported.
774771
If you spotted it first, help us to smash it by providing a detailed and welcomed
775-
<a class="reference external" href="https://github.com/OCA/storage/issues/new?body=module:%20fs_attachment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
772+
<a class="reference external" href="https://github.com/OCA/storage/issues/new?body=module:%20fs_attachment%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
776773
<p>Do not contact contributors directly about support or help with technical issues.</p>
777774
</div>
778775
<div class="section" id="credits">
@@ -807,15 +804,13 @@ <h3><a class="toc-backref" href="#toc-entry-18">Contributors</a></h3>
807804
<div class="section" id="maintainers">
808805
<h3><a class="toc-backref" href="#toc-entry-19">Maintainers</a></h3>
809806
<p>This module is maintained by the OCA.</p>
810-
<a class="reference external image-reference" href="https://odoo-community.org">
811-
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
812-
</a>
807+
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
813808
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
814809
mission is to support the collaborative development of Odoo features and
815810
promote its widespread use.</p>
816811
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
817812
<p><a class="reference external image-reference" href="https://github.com/lmignon"><img alt="lmignon" src="https://github.com/lmignon.png?size=40px" /></a></p>
818-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/storage/tree/18.0/fs_attachment">OCA/storage</a> project on GitHub.</p>
813+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/storage/tree/19.0/fs_attachment">OCA/storage</a> project on GitHub.</p>
819814
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
820815
</div>
821816
</div>

test-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ odoo_test_helper
22
requests_mock
33
vcrpy-unittest
44
s3fs>=2025.3.0
5+
6+
odoo-addon-server_environment @ git+https://github.com/OCA/server-env@refs/pull/247/head#subdirectory=server_environment
7+
odoo-addon-fs_storage @ git+https://github.com/OCA/storage@refs/pull/524/head#subdirectory=fs_storage

0 commit comments

Comments
 (0)