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 ??
لقد تم الإبلاغ عن هذا السؤال
1
الرد
12464
أدوات العرض
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
سبتمبر 17
|
10375 | ||
|
|
1
يوليو 25
|
5154 | ||
|
|
1
مايو 25
|
6097 | ||
|
|
1
أبريل 25
|
4872 | ||
|
|
1
فبراير 25
|
4221 |