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
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
1
Responder
10301
Vistas
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)
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
3
sept 17
|
8631 | ||
|
1
jul 25
|
1582 | ||
|
1
may 25
|
1555 | ||
|
1
abr 25
|
2184 | ||
|
1
feb 25
|
1475 |