首页 > 解决方案 > 在新窗口中打开 ir.actions.report

问题描述

正如标题中提到的,我需要在新窗口中打开一个报告。我知道我们可以使用targetact_window 来做到这一点,但我一直坚持如何实现它来打开报告。

<template id="myTemplate">
 <!--template-->
</template>

<report
    id="my_report_partner"
    string="Graphe"
    model="res.partner"
    report_type="qweb-html"
    file="myModule.myTemplate"
    name="myModule.myTemplate"
/>

按钮:

<button name="%(myModule.my_report_partner)d" type='action' string="open graph"/>

标签: odooodoo-12

解决方案


Try this, It could help you to archive your task.

return {
        'type': 'ir.actions.act_url',
        'target': 'new',
        'url': '/report/html/%s/%s?enable_editor' % ('event.event_event_report_template_badge', self.id),
    }

推荐阅读