diff options
| author | Denis Ledoux <dle@odoo.com> | 2017-02-03 11:15:21 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2017-02-03 11:19:01 +0100 |
| commit | 9c96631ddeb017c8d016ee6fafabc170bfcebfa8 (patch) | |
| tree | 76824386033fd8795e03e33e4c7e48ce8a39cabc /addons/report/models/ir_actions_report_xml.py | |
| parent | 01ac5949ef4ec89dc766674ab5c3fa6056010e68 (diff) | |
[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
Diffstat (limited to 'addons/report/models/ir_actions_report_xml.py')
| -rw-r--r-- | addons/report/models/ir_actions_report_xml.py | 2 |
1 files changed, 1 insertions, 1 deletions
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')] |
