diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-04-19 10:12:13 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-04-19 10:12:13 +0200 |
| commit | e7ab44929ff4aa3add8d00bab97fc3e879b9b91c (patch) | |
| tree | a600579e5c3c00c473550db8da591b6634fcbe0f /addons/web_graph | |
| parent | 45c48d684270f9a88af668f99a1d027df57f68d3 (diff) | |
| parent | f5c37eabe94a04ca62d08f46c1cf3a084fa77f19 (diff) | |
[MERGE] from trunk
bzr revid: xmo@openerp.com-20120419081213-m3fhofkgydj6gp1m
Diffstat (limited to 'addons/web_graph')
| -rw-r--r-- | addons/web_graph/i18n/bn.po | 23 | ||||
| -rw-r--r-- | addons/web_graph/i18n/bs.po | 23 | ||||
| -rw-r--r-- | addons/web_graph/i18n/en_AU.po | 23 | ||||
| -rw-r--r-- | addons/web_graph/i18n/es_CL.po | 23 | ||||
| -rw-r--r-- | addons/web_graph/i18n/sv.po | 23 | ||||
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 40 |
6 files changed, 129 insertions, 26 deletions
diff --git a/addons/web_graph/i18n/bn.po b/addons/web_graph/i18n/bn.po new file mode 100644 index 00000000000..e82aa395906 --- /dev/null +++ b/addons/web_graph/i18n/bn.po @@ -0,0 +1,23 @@ +# Bengali translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-02-06 17:33+0100\n" +"PO-Revision-Date: 2012-04-12 14:54+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Bengali <bn@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-04-13 05:38+0000\n" +"X-Generator: Launchpad (build 15070)\n" + +#. openerp-web +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "লেখচিত্র" diff --git a/addons/web_graph/i18n/bs.po b/addons/web_graph/i18n/bs.po new file mode 100644 index 00000000000..d8ca1b91203 --- /dev/null +++ b/addons/web_graph/i18n/bs.po @@ -0,0 +1,23 @@ +# Bosnian translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-02-06 17:33+0100\n" +"PO-Revision-Date: 2012-04-16 15:37+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Bosnian <bs@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-04-17 05:24+0000\n" +"X-Generator: Launchpad (build 15099)\n" + +#. openerp-web +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "Graf" diff --git a/addons/web_graph/i18n/en_AU.po b/addons/web_graph/i18n/en_AU.po new file mode 100644 index 00000000000..4ddfd3c2589 --- /dev/null +++ b/addons/web_graph/i18n/en_AU.po @@ -0,0 +1,23 @@ +# English (Australia) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-02-06 17:33+0100\n" +"PO-Revision-Date: 2012-04-09 03:27+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: English (Australia) <en_AU@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-04-10 05:02+0000\n" +"X-Generator: Launchpad (build 15070)\n" + +#. openerp-web +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "Graph" diff --git a/addons/web_graph/i18n/es_CL.po b/addons/web_graph/i18n/es_CL.po new file mode 100644 index 00000000000..ef89f84940e --- /dev/null +++ b/addons/web_graph/i18n/es_CL.po @@ -0,0 +1,23 @@ +# Spanish (Chile) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-02-06 17:33+0100\n" +"PO-Revision-Date: 2012-04-14 15:16+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Spanish (Chile) <es_CL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-04-15 04:48+0000\n" +"X-Generator: Launchpad (build 15070)\n" + +#. openerp-web +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "Gráfico" diff --git a/addons/web_graph/i18n/sv.po b/addons/web_graph/i18n/sv.po new file mode 100644 index 00000000000..98335a89577 --- /dev/null +++ b/addons/web_graph/i18n/sv.po @@ -0,0 +1,23 @@ +# Swedish translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-02-06 17:33+0100\n" +"PO-Revision-Date: 2012-04-17 13:21+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Swedish <sv@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-04-18 04:57+0000\n" +"X-Generator: Launchpad (build 15108)\n" + +#. openerp-web +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "Diagram" diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index d962c7d6752..7016b9d8d85 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -2,7 +2,7 @@ * OpenERP web_graph *---------------------------------------------------------*/ -openerp.web_graph = function (openerp) { +openerp.web_graph = function (instance) { var COLOR_PALETTE = [ '#cc99ff', '#ccccff', '#48D1CC', '#CFD784', '#8B7B8B', '#75507b', '#b0008c', '#ff0000', '#ff8e00', '#9000ff', '#0078ff', '#00ff00', @@ -12,11 +12,12 @@ var COLOR_PALETTE = [ '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f', '#f57900', '#cc0000', '#d400a8']; -var QWeb = openerp.web.qweb, - _lt = openerp.web._lt; -openerp.web.views.add('graph', 'openerp.web_graph.GraphView'); -openerp.web_graph.GraphView = openerp.web.View.extend({ +var QWeb = instance.web.qweb, + _lt = instance.web._lt; +instance.web.views.add('graph', 'instance.web_graph.GraphView'); +instance.web_graph.GraphView = instance.web.View.extend({ display_name: _lt('Graph'), + view_type: "graph", init: function(parent, dataset, view_id, options) { this._super(parent); @@ -39,27 +40,13 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ } this._super(); }, - start: function() { + on_loaded: function(fields_view_get) { var self = this; - this._super(); - var loaded; - if (this.embedded_view) { - loaded = $.when([self.embedded_view]); - } else { - loaded = this.rpc('/web/view/load', { - model: this.dataset.model, - view_id: this.view_id, - view_type: 'graph' - }); - } - return $.when( - this.dataset.call_and_eval('fields_get', [false, {}], null, 1), - loaded) - .then(function (fields_result, view_result) { - self.fields = fields_result[0]; - self.fields_view = view_result[0]; - self.on_loaded(self.fields_view); - }); + self.fields_view = fields_view_get; + return this.dataset.call_and_eval('fields_get', [false, {}], null, 1).pipe(function(fields_result) { + self.fields = fields_result; + return self.on_loaded_2(); + }); }, /** * Returns all object fields involved in the graph view @@ -72,7 +59,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ } return fs; }, - on_loaded: function() { + on_loaded_2: function() { this.chart = this.fields_view.arch.attrs.type || 'pie'; this.orientation = this.fields_view.arch.attrs.orientation || 'vertical'; @@ -91,6 +78,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ }, this); this.ordinate = this.columns[0].name; this.is_loaded.resolve(); + return $.when(); }, schedule_chart: function(results) { var self = this; |
