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

Asked by Nhomar - Vauxoo

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.

[1] http://www.urbandictionary.com/define.php?term=RTFC

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Nhomar - Vauxoo
Solved:
Last query:
Last reply:
Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#1

I anwer myself applying the best way to do in this world.... It means doing a RTFM.

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.

Good Job.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#2

Nhomar Hernandez (Vauxoo) suggests this article as an answer to your question:
FAQ #2164: “[trunk] How is he best way to debug Qweb Templates ?”.