Merge lp:~openerp-dev/openerp-web/7.0-opw-580435-port-vme into lp:openerp-web/7.0

Proposed by Vidhin Mehta (OpenERP)
Status: Merged
Merged at revision: 3969
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-580435-port-vme
Merge into: lp:openerp-web/7.0
Diff against target: 20 lines (+2/-1)
1 file modified
addons/web_graph/static/src/js/graph.js (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-580435-port-vme
Reviewer Review Type Date Requested Status
Christophe Matthieu (OpenERP) (community) Needs Information
Review via email: mp+144863@code.launchpad.net

Description of the change

Graph view usablity bug.
Go to : Reporting -> Sale -> lead analysis (graph view) third column don't show any name in x-axis,
and in list view shows "undefine".

To post a comment you must log in.
Revision history for this message
Christophe Matthieu (OpenERP) (chm-openerp) wrote :

Hi,
Why do you use "_t" instead of "_lt" ?
Thanks.

review: Needs Information
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

_lt is more costly and only necessary at the toplevel of the module: it defers the translation until the moment it is *used* instead of doing it directly, so it's for defining translatable strings before translations are loaded.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

(& it can be slightly tricker as it returns an object-which-can-be-stringified where _t returns a string directly)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web_graph/static/src/js/graph.js'
2--- addons/web_graph/static/src/js/graph.js 2012-12-13 14:09:14 +0000
3+++ addons/web_graph/static/src/js/graph.js 2013-01-25 07:17:19 +0000
4@@ -5,6 +5,7 @@
5 openerp.web_graph = function (instance) {
6
7 var _lt = instance.web._lt;
8+var _t = instance.web._t;
9
10 // removed ``undefined`` values
11 var filter_values = function (o) {
12@@ -365,7 +366,7 @@
13 }).then(function() {
14 var res = {
15 'data': result,
16- 'ticks': _.map(ticks, function(el, key) { return [el, key] })
17+ 'ticks': _.map(ticks, function(el, key) { return [el, key || _t("Undefined")] })
18 };
19 return res;
20 });