From f78eb154ee9107c8585d0c3a814a4230f7e55b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 26 Jun 2026 15:17:14 +0200 Subject: [PATCH] Resolve Tryton modules using entrypoints The Pool tries to resolve registered string using the path `trytond.modules.` which can not always be imported if the module is using an entry pointing to another package. Closes #14914 (grafted from bb96325e829df570aac1f7624c862a660c0be286) --HG-- branch : 8.0 --- trytond/trytond/tools/misc.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/trytond/trytond/tools/misc.py b/trytond/trytond/tools/misc.py index 35a5f4084f..7f3366ee14 100644 --- a/trytond/trytond/tools/misc.py +++ b/trytond/trytond/tools/misc.py @@ -177,8 +177,15 @@ def is_instance_method(cls, method): def resolve(name): "Resolve a dotted name to a global object." name = name.split('.') - used = name.pop(0) - found = importlib.import_module(used) + if name[:2] == ['trytond', 'modules']: + # import the Tryton module using entry point + name = name[2:] + used = name.pop(0) + found = import_module(used) + used = found.__name__ + else: + used = name.pop(0) + found = importlib.import_module(used) for n in name: used = used + '.' + n try: