HVH*_*HVH 4 python-3.5 odoo-11
我正在将模块从 odoo v10 升级到 odoo v11。发现将get_action替换为report_action。所以我使用了如下代码
self.env.ref('report_action_name').report_action(self, data=data, config=False)
但它给了我错误 AttributeError: 'ir.ui.view' object has no attribute 'report_action' 提前致谢
确保这report_action_name是record_id报告的内容。例如:
Python
self.env.ref('module_name.record_id').report_action(self, data=data, config=False)
Run Code Online (Sandbox Code Playgroud)
XML
<record id="record_id" model="ir.actions.report">
<field name="name">Name</field>
<field name="model">Model</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module_name.report_template_id</field>
</record>
Run Code Online (Sandbox Code Playgroud)
报告 XML
<template id="report_template_id">
<Your code>
</template>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4612 次 |
| 最近记录: |