【问题标题】:open ir.actions.report in new window在新窗口中打开 ir.actions.report
【发布时间】:2021-09-01 11:36:03
【问题描述】:

正如标题中提到的,我需要在新窗口中打开一份报告。我知道我们可以使用 target 和 act_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"/>

【问题讨论】:

    标签: odoo odoo-12


    【解决方案1】:

    试试这个,它可以帮助你归档你的任务。

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

    【讨论】:

    • 它工作得很好,但它只是在新选项卡而不是新窗口中打开,我错过了打印按钮
    • 无法在新窗口中打开(我在odoo中没有看到),您可以添加“?download=true”打印报告
    • 你的意思是在网址中?不起作用..没有任何改变
    猜你喜欢
    • 2014-03-24
    • 1970-01-01
    • 2015-09-04
    • 2014-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多