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:
- CRM
- e-Commerce
- 会計
- 在庫
- PoS
- Project
- MRP
この質問にフラグが付けられました
1
返信
10555
ビュー
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
|
8858 | ||
|
1
7月 25
|
2048 | ||
|
1
5月 25
|
2266 | ||
|
1
4月 25
|
2532 | ||
|
1
2月 25
|
1821 |