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
- Účtovníctvo
- Sklady
- PoS
- Project
- MRP
This question has been flagged
1
Odpoveď
10330
Zobrazenia
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)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
RegistráciaRelated Posts | Replies | Zobrazenia | Aktivita | |
---|---|---|---|---|
|
3
sep 17
|
8669 | ||
|
1
júl 25
|
1637 | ||
|
1
máj 25
|
1602 | ||
|
1
apr 25
|
2226 | ||
|
1
feb 25
|
1516 |