Community mailing list archives


Phillip Stack, Phillip
- 10/18/2016 09:33:12

There is a discussion going on at STACKOVERFLOW  regarding the use cases for CLIENTvsSERVER side xml processing. I am not an expert on client centric MVC so please forgive me. Here is the question.

I have a question about the qweb templates of Odoo. Why can we create a template inside the static folder and have it rendered on the client by javascript and why can we create a template that will be rendered on the server side and returned by a controller?

What is the difference, what can I do on the one that I cannot on the other and what are the different use cases?

Example of frontend rendering:

Take a look at addons/web/static/lib/qweb/qweb2.js. This file has the render function which is used to render templates created on the static folder. For an example of its usage see addons/account/static/src/js/account_reconciliation_widgets.js. There are multiple Qweb.render(template_name) statements there. So from what I can understand templates inside static are accesible to the client in their initial format and rather the web client is responsible for the rendering

This is not my question however I am echoing it here as I think people can benefit from this discussion (most importantly myself).

Please comment!


AIM Systems