Skip to Content
Menu
This question has been flagged
2049 Views

Hey Dear's I need to render the following code snippet result to template am beginner to odoo and python anyone help me thanks 

the query is working on the pgadmin and anyone help me to render it on the qweb template 

like the following 

Odoo Version 13

<template id="product" name="product">
<t t-call="website.layout">
<div id="wrap" class="oe_structure oe_empty">
<table>
<tbody>
<t t-foreach="product" t-as="product">
<td><img class="image"
 t-att-src="'data:image/png;base64,%s' % to_text(o.image_1920)"
<b>
<t t-esc="product.name"/>
<br/>
</b>

<t t-esc="product.description"/>
<br/>
</td>
</t>
</tbody>
</table>
</div>
</t>
</template>
query = '''SELECT name, description, image
FROM product
ORDER BY id DESC
limit 4 '''
request.cr.execute(query)
text_data = request.cr.fetchall()
Avatar
Discard