Skip to content

Commit

Permalink
[18.0][MIG] module_auto_update: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fkantelberg committed Feb 7, 2025
1 parent 5bc5661 commit 156dca5
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 36 deletions.
34 changes: 19 additions & 15 deletions module_auto_update/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Module Auto Update
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/17.0/module_auto_update
:target: https://github.com/OCA/server-tools/tree/18.0/module_auto_update
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-module_auto_update
:target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-module_auto_update
: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/server-tools&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -34,6 +34,10 @@ exploits these mechanisms to update a database by upgrading only the
modules for which the hash has changed since the last successful
upgrade.

As an alternative to this module
`click-odoo-update <https://github.com/acsone/click-odoo-contrib>`__ can
also be integrated in your non-Odoo maintenance tools instead.

**Table of contents**

.. contents::
Expand All @@ -44,10 +48,10 @@ Configuration

This module supports the following system parameters:

- ``module_auto_update.exclude_patterns``: comma-separated list of file
name patterns to ignore when computing addon checksums. Defaults to
``*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*``. Filename
patterns must be compatible with the python ``fnmatch`` function.
- ``module_auto_update.exclude_patterns``: comma-separated list of file
name patterns to ignore when computing addon checksums. Defaults to
``*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*,tests/*``. Filename
patterns must be compatible with the python ``fnmatch`` function.

In addition to the above pattern, .po files corresponding to languages
that are not installed in the Odoo database are ignored when computing
Expand Down Expand Up @@ -86,7 +90,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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/server-tools/issues/new?body=module:%20module_auto_update%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20module_auto_update%0Aversion:%2018.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.

Expand All @@ -104,12 +108,12 @@ Authors
Contributors
------------

- Brent Hughes <[email protected]>
- Juan José Scarafía <[email protected]>
- Jairo Llopis <[email protected]>
- Stéphane Bidoul <[email protected]> (https://acsone.eu)
- Eric Antones <[email protected]>
- Manuel Engel <[email protected]>
- Brent Hughes <[email protected]>
- Juan José Scarafía <[email protected]>
- Jairo Llopis <[email protected]>
- Stéphane Bidoul <[email protected]> (https://acsone.eu)
- Eric Antones <[email protected]>
- Manuel Engel <[email protected]>

Maintainers
-----------
Expand All @@ -124,6 +128,6 @@ 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/server-tools <https://github.com/OCA/server-tools/tree/17.0/module_auto_update>`_ project on GitHub.
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/module_auto_update>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion module_auto_update/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Module Auto Update",
"summary": "Automatically update Odoo modules",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Extra Tools",
"website": "https://github.com/OCA/server-tools",
"author": "LasLabs, "
Expand Down
5 changes: 1 addition & 4 deletions module_auto_update/hooks.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import SUPERUSER_ID, api

from .models.module import PARAM_INSTALLED_CHECKSUMS


def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def uninstall_hook(env):
env["ir.config_parameter"].set_param(PARAM_INSTALLED_CHECKSUMS, False)
15 changes: 8 additions & 7 deletions module_auto_update/models/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

PARAM_INSTALLED_CHECKSUMS = "module_auto_update.installed_checksums"
PARAM_EXCLUDE_PATTERNS = "module_auto_update.exclude_patterns"
DEFAULT_EXCLUDE_PATTERNS = "*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*"
DEFAULT_EXCLUDE_PATTERNS = "*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*,tests/*"

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -127,9 +127,9 @@ def upgrade_changed_checksum(self, overwrite_existing_translations=False):
overwrite_existing_translations,
)

tools.config[
"overwrite_existing_translations"
] = overwrite_existing_translations
tools.config["overwrite_existing_translations"] = (
overwrite_existing_translations
)

_logger.info("Updating modules list...")
self.update_list()
Expand Down Expand Up @@ -177,9 +177,10 @@ def upgrade_changed_checksum(self, overwrite_existing_translations=False):
partial_modules = self._get_modules_partially_installed()
if partial_modules:
raise IncompleteUpgradeError(
"Checksum upgrade successful "
"but incomplete for the following modules: %s"
% ",".join(partial_modules.mapped("name"))
"Checksum upgrade successful but "
"incomplete for the following modules: {}".format(
",".join(partial_modules.mapped("name"))
)
)

_logger.info("Checksum upgrade complete.")
Expand Down
2 changes: 1 addition & 1 deletion module_auto_update/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This module supports the following system parameters:

- `module_auto_update.exclude_patterns`: comma-separated list of file
name patterns to ignore when computing addon checksums. Defaults to
`*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*`. Filename patterns
`*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*,tests/*`. Filename patterns
must be compatible with the python `fnmatch` function.

In addition to the above pattern, .po files corresponding to languages
Expand Down
4 changes: 4 additions & 0 deletions module_auto_update/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ addons, and save them in the database. It also provides a method that
exploits these mechanisms to update a database by upgrading only the
modules for which the hash has changed since the last successful
upgrade.

As an alternative to this module
[click-odoo-update](https://github.com/acsone/click-odoo-contrib) can
also be integrated in your non-Odoo maintenance tools instead.
22 changes: 14 additions & 8 deletions module_auto_update/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

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

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,12 +369,15 @@ <h1 class="title">Module Auto Update</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3544468e931dc11637cfb88c85e1486accc4d9252d879ce9e8a0ba4a7ccedfbd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/server-tools/tree/17.0/module_auto_update"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-module_auto_update"><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/server-tools&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="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/server-tools/tree/18.0/module_auto_update"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-module_auto_update"><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/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon provides mechanisms to compute sha1 hashes of installed
addons, and save them in the database. It also provides a method that
exploits these mechanisms to update a database by upgrading only the
modules for which the hash has changed since the last successful
upgrade.</p>
<p>As an alternative to this module
<a class="reference external" href="https://github.com/acsone/click-odoo-contrib">click-odoo-update</a> can
also be integrated in your non-Odoo maintenance tools instead.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -394,7 +398,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<ul class="simple">
<li><tt class="docutils literal">module_auto_update.exclude_patterns</tt>: comma-separated list of file
name patterns to ignore when computing addon checksums. Defaults to
<tt class="docutils literal"><span class="pre">*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*</span></tt>. Filename
<tt class="docutils literal"><span class="pre">*.pyc,*.pyo,i18n/*.pot,i18n_extra/*.pot,static/*,tests/*</span></tt>. Filename
patterns must be compatible with the python <tt class="docutils literal">fnmatch</tt> function.</li>
</ul>
<p>In addition to the above pattern, .po files corresponding to languages
Expand Down Expand Up @@ -428,7 +432,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/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/server-tools/issues/new?body=module:%20module_auto_update%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20module_auto_update%0Aversion:%2018.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">
Expand Down Expand Up @@ -456,11 +460,13 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">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" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/17.0/module_auto_update">OCA/server-tools</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/18.0/module_auto_update">OCA/server-tools</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down

0 comments on commit 156dca5

Please sign in to comment.