I tried to use QWeb Template in a custom view. I don't find any documentation explaining this, any reference?
Here's the sample code:
<record id="realestate_property_view_form" model="ir.ui.view">
<field name="name">realestate.property.form</field>
<field name="model">realestate.property</field>
<field name="arch" type="xml">
<form string="Property">
<header>
<button name="approve_action" type="object" string="Approve"/>
</header>
<sheet>
<group>
<group>
<field name="name" />
<field name="address" />
</group>
<template>
<t t-name="templatePreviewBox">
<div>
<img t-attf-src="'http://localhost:3000/rest/api/' + record.image_url.raw_value" />
</div>
</t>
</template>
</group>
</sheet>
</form>
</field>
</record>
The problem is that if I inspect element in the browser, it's still displayed as <img t-attf-src>
instead of <img src>
, and the string expression seems not evaluated.
I find the documentation in Odoo official site is not complete enough, so I really appreciate for any references or documentation about this QWeb.