Odoo Help


Calling QWeb template in Javascript

Axel Kerbec
on 10/27/16, 4:32 PM 1,888 views

Hello, is there a way I can render a QWeb template template from Javascript? As an example, I have the following template:


<template id="theme.tp_remove_button"> 
    <a class="btn btn-default tp_delete">
        <i class="fa fa-minus"></i>

Is there any way I can call it from my Javascript file in the frontend? I know that I can create static QWeb templates and render them, but that would mean that every piece of code I plan on redering on both the server and the client will need two separate templates!

Thank you for the help!

--Hilar AK--



Hilar AK
On 10/31/16, 8:20 AM

var modal = qweb.render("your template", {                modal_title: modal_title,                modal_body: modal_body            });

or check the render function in qweb js

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/27/16, 4:32 PM
Seen: 1888 times
Last updated: 10/31/16, 8:20 AM