[trunk] How is he best way to debug Qweb Templates ?

Created by Nhomar - Vauxoo on on 2012-12-17
Keywords:
qweb debug openerp-web
Last updated by:
Nhomar - Vauxoo on on 2012-12-17

Hello.

I really need one effective way to debug Qweb Enviroment.

It means:

I.E When i define a variable in any template system, frequently you have a list of variables availables by default i look in documentation and i don have this information.

BTW applying the RTFC [1] I aw some examples in web_* modules, mixed with the basic documentation already available i find some workaround,

But, i didn't figure out one effective way to debug the internal variables in Qweb template, as it is rendered on browser, ther i can define some this.* console.log, but how is the best way to intercept what is the result for the rendering, and make it line by line or something like that.

Thanks.

Answer:

In doc we have:

Escape Hatches / debugging¶
t-log=expression
Parameters: expression (Expression) –
Evaluates the provided expression (in the current template context) and logs its result via console.log.

t-debug
Injects a debugger breakpoint (via the debugger; statement) in the compiled template output.

t-js=context BODY
Parameters:
context (Name) –
BODY – javascript code
Injects the provided BODY javascript code into the compiled template, passing it the current template context using the name specified by context.

I put here for somebody else that look how debug Qweb.