in controller we use --> request.render() method to render qweb template but this isn't working in model how can i render qweb template throug model ??
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
10352
查看
Hi, here you have a snippet of code that works for me:
def _qweb_render(self, o=None):
val = {
'docs': o,
'doc_model': 'motor.record',
'doc_ids': [o.id],
}
html = self.pool["ir.ui.view"].render(self.env.cr, self.env.uid, 'yourmodule.your_view_xml_id, val, engine='ir.qweb', context=self.env.context).decode('utf8')
return HTMLSafe(html)
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
3
9月 17
|
8702 | ||
|
1
7月 25
|
1688 | ||
|
1
5月 25
|
1674 | ||
|
1
4月 25
|
2262 | ||
|
1
2月 25
|
1550 |