From 9c96631ddeb017c8d016ee6fafabc170bfcebfa8 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 3 Feb 2017 11:15:21 +0100 Subject: [PATCH] [FIX] report: associated views with report name without dots When setting a report with a `report_name` without dots, the associated views button raised an exception. This has been introduced during the migration to the new API at revision 47c67b640b0d95a7df58485923abfc0794902d87 Before, a try/except made sure the exception to not raise the exception in case the report name could not be split in two parts. In this revision, instead of doing the try/except, we check if the result of the split has a minimum length of 2. opw-706343 --- addons/report/models/ir_actions_report_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report/models/ir_actions_report_xml.py b/addons/report/models/ir_actions_report_xml.py index 667a2b43349..8461815e389 100644 --- a/addons/report/models/ir_actions_report_xml.py +++ b/addons/report/models/ir_actions_report_xml.py @@ -17,7 +17,7 @@ class ir_actions_report(models.Model): """ self.ensure_one() action_ref = self.env.ref('base.action_ui_view') - if not action_ref: + if not action_ref or len(self.report_name.split('.')) < 2: return False action_data = action_ref.read()[0] action_data['domain'] = [('name', 'ilike', self.report_name.split('.')[1]), ('type', '=', 'qweb')]