From 51d9589e02be582545310993bd697ea81aee34d6 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 10 Oct 2018 13:56:03 +0000 Subject: [PATCH] [FIX] base: print report without template In case a report has no template defined, the fallback is on the first body_parent that matched the xpath '//main' xpath method returns a list Fixes #27406 closes odoo/odoo#27630 --- odoo/addons/base/models/ir_actions_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_actions_report.py b/odoo/addons/base/models/ir_actions_report.py index 00f57434161..11208fda298 100644 --- a/odoo/addons/base/models/ir_actions_report.py +++ b/odoo/addons/base/models/ir_actions_report.py @@ -305,7 +305,7 @@ class IrActionsReport(models.Model): bodies = [] res_ids = [] - body_parent = root.xpath('//main') + body_parent = root.xpath('//main')[0] # Retrieve headers for node in root.xpath(match_klass.format('header')): body_parent = node.getparent()