Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make Qweb template engine in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 756
    Comment on it

    QWeb is an XML-based templating language, similar to Genshi, Thymeleaf or Facelets. It has the following characteristics:
    It's implemented fully in JavaScript and rendered in the browser
    Each template file (XML files) contains multiple templates.
    It has special support in Odoo Web's Widget(), though it can be used outside of Odoo's web client (and it's possible to use Widget() without relying on QWeb
    For Example code is below.

    <?xml version="1.0" encoding="UTF-8"?>
    <templates xml:space="preserve">
        <t t-name="HomePageTemplate">
            <div style="background-color: red;">This is simple HTML</div>
        </t>
    </templates>
    

    Note-QWeb.render() looks for the specified template, renders it to a string and returns the result.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: