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 ??
Tämä kysymys on merkitty
1
Vastaa
12467
Näkymät
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)
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|
|
3
syysk. 17
|
10375 | ||
|
|
1
heinäk. 25
|
5154 | ||
|
|
1
toukok. 25
|
6097 | ||
|
QWeb: use t-if to check birthday date
Ratkaistu
|
|
1
huhtik. 25
|
4872 | |
|
|
1
helmik. 25
|
4221 |