From 156dca5a6e24cd82922acf2c14840db521e1059c Mon Sep 17 00:00:00 2001 From: fkantelberg Date: Tue, 4 Feb 2025 13:50:31 +0100 Subject: [PATCH] [18.0][MIG] module_auto_update: Migration to 18.0 --- module_auto_update/README.rst | 34 +++++++++++-------- module_auto_update/__manifest__.py | 2 +- module_auto_update/hooks.py | 5 +-- module_auto_update/models/module.py | 15 ++++---- module_auto_update/readme/CONFIGURE.md | 2 +- module_auto_update/readme/DESCRIPTION.md | 4 +++ .../static/description/index.html | 22 +++++++----- 7 files changed, 48 insertions(+), 36 deletions(-) diff --git a/module_auto_update/README.rst b/module_auto_update/README.rst index 0e33fbbe501..900472f87d2 100644 --- a/module_auto_update/README.rst +++ b/module_auto_update/README.rst @@ -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| @@ -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 `__ can +also be integrated in your non-Odoo maintenance tools instead. + **Table of contents** .. contents:: @@ -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 @@ -86,7 +90,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -104,12 +108,12 @@ Authors Contributors ------------ -- Brent Hughes -- Juan José Scarafía -- Jairo Llopis -- Stéphane Bidoul (https://acsone.eu) -- Eric Antones -- Manuel Engel +- Brent Hughes +- Juan José Scarafía +- Jairo Llopis +- Stéphane Bidoul (https://acsone.eu) +- Eric Antones +- Manuel Engel Maintainers ----------- @@ -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 `_ project on GitHub. +This module is part of the `OCA/server-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/module_auto_update/__manifest__.py b/module_auto_update/__manifest__.py index 3863b102c40..7eeb64d6699 100644 --- a/module_auto_update/__manifest__.py +++ b/module_auto_update/__manifest__.py @@ -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, " diff --git a/module_auto_update/hooks.py b/module_auto_update/hooks.py index 08e06ed8fdd..2057ae38ce1 100644 --- a/module_auto_update/hooks.py +++ b/module_auto_update/hooks.py @@ -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) diff --git a/module_auto_update/models/module.py b/module_auto_update/models/module.py index 8619e1bb292..86a9c584b41 100644 --- a/module_auto_update/models/module.py +++ b/module_auto_update/models/module.py @@ -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__) @@ -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() @@ -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.") diff --git a/module_auto_update/readme/CONFIGURE.md b/module_auto_update/readme/CONFIGURE.md index 2a70fffeeff..30934e987fa 100644 --- a/module_auto_update/readme/CONFIGURE.md +++ b/module_auto_update/readme/CONFIGURE.md @@ -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 diff --git a/module_auto_update/readme/DESCRIPTION.md b/module_auto_update/readme/DESCRIPTION.md index 1d5c443af7a..a7751105e02 100644 --- a/module_auto_update/readme/DESCRIPTION.md +++ b/module_auto_update/readme/DESCRIPTION.md @@ -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. diff --git a/module_auto_update/static/description/index.html b/module_auto_update/static/description/index.html index b9b31d70a6e..32b7956561a 100644 --- a/module_auto_update/static/description/index.html +++ b/module_auto_update/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -: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. @@ -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 } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,12 +369,15 @@

Module Auto Update

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:3544468e931dc11637cfb88c85e1486accc4d9252d879ce9e8a0ba4a7ccedfbd !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: LGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

+

Production/Stable License: LGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

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.

+

As an alternative to this module +click-odoo-update can +also be integrated in your non-Odoo maintenance tools instead.

Table of contents

    @@ -394,7 +398,7 @@

    Configuration

    • 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 +*.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 @@ -428,7 +432,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

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

@@ -456,11 +460,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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 project on GitHub.

+

This module is part of the OCA/server-tools project on GitHub.

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