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 ??
La domanda è stata contrassegnata
1
Rispondi
12468
Visualizzazioni
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)
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati| Post correlati | Risposte | Visualizzazioni | Attività | |
|---|---|---|---|---|
|
|
3
set 17
|
10375 | ||
|
|
1
lug 25
|
5154 | ||
|
|
1
mag 25
|
6097 | ||
|
|
1
apr 25
|
4872 | ||
|
|
1
feb 25
|
4221 |