changeset b928473f65e5 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=b928473f65e5
description:
        Display asserted inherit expression when nothing found

        issue11560
        review419311003
diffstat:

 trytond/ir/ui/view.py |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (15 lines):

diff -r ecaf2dd04f42 -r b928473f65e5 trytond/ir/ui/view.py
--- a/trytond/ir/ui/view.py     Wed Jun 15 18:52:38 2022 +0200
+++ b/trytond/ir/ui/view.py     Wed Jun 15 18:59:58 2022 +0200
@@ -265,8 +265,9 @@
     def inherit_apply(cls, tree, inherit):
         root_inherit = inherit.getroottree().getroot()
         for element in root_inherit:
-            targets = tree.xpath(element.get('expr'))
-            assert targets
+            expr = element.get('expr')
+            targets = tree.xpath(expr)
+            assert targets, "No elements found for expression %r" % expr
             for target in targets:
                 position = element.get('position', 'inside')
                 new_tree = getattr(cls, '_inherit_apply_%s' % position)(

Reply via email to