【发布时间】:2019-11-04 05:11:05
【问题描述】:
您好,我正在尝试从 Odoo 12 中的模板创建 html。我从以前的 Odoo 8 中知道我们可以使用
html = self.env['report'].get_html(self, 'my_addon.my_template')
Odoo 12 不再支持get_html 方法。我读到它已被render_qweb_html 取代
但是当我这样尝试时
html = self.env['ir.actions.report'].render_qweb_html(self, 'my_addon.my_template')
Odoo 以
回应AttributeError: 'str' object has no attribute 'setdefault'
我是否使用了错误的方法?谁能指出我犯的错误?我已经在插件文件夹中查找了示例,但没有找到。
谢谢
【问题讨论】: