Merge lp:~camptocamp/c2c-web-addons/fix-qweb-20121218 into lp:c2c-web-addons

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 13
Proposed branch: lp:~camptocamp/c2c-web-addons/fix-qweb-20121218
Merge into: lp:c2c-web-addons
Diff against target: 11 lines (+1/-0)
1 file modified
web_translate_dialog_page/static/src/js/web_translate_dialog_page.js (+1/-0)
To merge this branch: bzr merge lp:~camptocamp/c2c-web-addons/fix-qweb-20121218
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp no test, review Approve
Review via email: mp+140387@code.launchpad.net

Description of the change

Add a QWeb variable

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Usually from my observation, the variable QWeb is initialized at the top level of the module's namespace, so it is declared only once for the whole namespace.

I tend to think that we should respect this convention even if we need it only one time in the namespace.
Though, I do not have any formal argument other than convention here, so I let you decide.

Note that if you don't declare a global to the module's namespace, you probably would not need to initialize a local variable but just replace "QWeb.render" by "openerp.web.qweb.render".

review: Approve (no test, review)
14. By Yannick Vaucher @ Camptocamp

[IMP] web_translate_dialog_page - move QWeb variable at top level of module namespace for convention

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the review,

Here we go for some more convention

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'web_translate_dialog_page/static/src/js/web_translate_dialog_page.js'
2--- web_translate_dialog_page/static/src/js/web_translate_dialog_page.js 2012-10-08 06:04:42 +0000
3+++ web_translate_dialog_page/static/src/js/web_translate_dialog_page.js 2012-12-18 17:30:29 +0000
4@@ -1,6 +1,7 @@
5 openerp.web_translate_dialog_page = function (openerp) {
6
7 var _t = openerp.web._t;
8+ var QWeb = openerp.web.qweb;
9
10 openerp.web.PageView.include({
11 on_loaded: function(data) {

Subscribers

People subscribed via source and target branches

to all changes: