手动新建报表动作和报表视图的注意事项 - xiaohao0576/odoo-doc GitHub Wiki
def associated_view(self):
"""Used in the ir.actions.report form view in order to search naively after the view(s)
used in the rendering.
"""
self.ensure_one()
action_ref = self.env.ref('base.action_ui_view')
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')]
return action_data