From cd223660ffa1ed8906587a0a8d48520103534e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 28 Nov 2025 15:32:06 +0100 Subject: [PATCH] Make option --all appends the res module to the list of updates Since d237ff78d187 the res module is not updated even if it depends on ir module because it is an early module. Closes #14401 --- trytond/trytond/commandline.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/trytond/trytond/commandline.py b/trytond/trytond/commandline.py index 9a15232dee..27823f667d 100644 --- a/trytond/trytond/commandline.py +++ b/trytond/trytond/commandline.py @@ -15,6 +15,31 @@ from trytond import __version__ logger = logging.getLogger(__name__) +class ExtendConstAction(argparse.Action): + def __init__(self, + option_strings, + dest, + const=None, + default=None, + required=False, + help=None, + metavar=None): + super().__init__( + option_strings=option_strings, + dest=dest, + nargs=0, + const=const, + default=default, + required=required, + help=help, + metavar=metavar) + + def __call__(self, parser, namespace, values, option_sting=None): + items = getattr(namespace, self.dest, [])[:] + items.extend(self.const) + setattr(namespace, self.dest, items) + + def database_completer(parsed_args, **kwargs): import trytond.config as config from trytond.transaction import Transaction @@ -119,8 +144,8 @@ def get_parser_admin(): "--indexes", dest="indexes", action=getattr(argparse, 'BooleanOptionalAction', 'store_true'), default=None, help="update indexes") - parser.add_argument("--all", dest="update", action="append_const", - const="ir", help="update all activated modules") + parser.add_argument("--all", dest="update", action=ExtendConstAction, + const=['ir', 'res'], help="update all activated modules") parser.add_argument("--activate-dependencies", dest="activatedeps", action="store_true", help="activate missing dependencies of updated modules")