[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 47c67b640b
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
This commit is contained in:
@@ -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')]
|
||||
|
||||
Reference in New Issue
Block a user