diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 5f0ecc80827..ea160d6faee 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -156,30 +156,32 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess var to_load = _.difference(result, self.module_list).join(','); self.module_list = all_modules; - var loaded = $.Deferred().resolve().promise(); - if (to_load.length) { + var loaded = self.rpc('/web/webclient/translations', params).then(function(trans) { + instance.web._t.database.set_bundle(trans); + }); + var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; + if(to_load.length) { loaded = $.when( - self.rpc('/web/webclient/csslist', {mods: to_load}, self.do_load_css), + loaded, + self.rpc('/web/webclient/csslist', {mods: to_load}).then(self.do_load_css), self.rpc('/web/webclient/qweblist', {mods: to_load}).pipe(self.do_load_qweb), - self.rpc('/web/webclient/translations', params).pipe(function(trans) { - instance.web._t.database.set_bundle(trans); - var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; - return self.rpc('/web/webclient/jslist', {mods: to_load}).pipe(function(files) { - return self.do_load_js(file_list.concat(files)); - }).then(function () { - if (!Date.CultureInfo.pmDesignator) { - // If no am/pm designator is specified but the openerp - // datetime format uses %i, date.js won't be able to - // correctly format a date. See bug#938497. - Date.CultureInfo.amDesignator = 'AM'; - Date.CultureInfo.pmDesignator = 'PM'; - } - }); - })) + self.rpc('/web/webclient/jslist', {mods: to_load}).then(function(files) { + file_list = file_list.concat(files); + }) + ); } - return loaded.then(function() { + return loaded.pipe(function () { + return self.do_load_js(file_list); + }).then(function() { self.on_modules_loaded(); self.trigger('module_loaded'); + if (!Date.CultureInfo.pmDesignator) { + // If no am/pm designator is specified but the openerp + // datetime format uses %i, date.js won't be able to + // correctly format a date. See bug#938497. + Date.CultureInfo.amDesignator = 'AM'; + Date.CultureInfo.pmDesignator = 'PM'; + } }); }); }, diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 7d328f012fe..5b7314a00f2 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -159,10 +159,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.has_been_loaded.resolve(); // Add bounce effect on button 'Edit' when click on readonly page view. - this.$el.find(".oe_form_field,label").on('click', function (e) { + this.$el.find(".oe_form_group_row,.oe_form_field,label").on('click', function (e) { if(self.get("actual_mode") == "view") { var $button = self.options.$buttons.find(".oe_form_button_edit"); $button.effect('bounce', {distance: 18, times: 5}, 150) + e.stopPropagation(); } }); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 015cd1636f1..0bee5cad755 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -830,6 +830,10 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi this.$el.prepend( $('
').html(this.options.action.help) ); + var create_nocontent = this.$buttons; + this.$el.find('.oe_view_nocontent').click(function() { + create_nocontent.effect('bounce', {distance: 18, times: 5}, 150); + }); } }); instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.ListView.List# */{ @@ -919,8 +923,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. this.records.bind(event, callback); }, this); - this.$_element = $('') - .appendTo(document.body) + this.$current = $('') .delegate('th.oe_list_record_selector', 'click', function (e) { e.stopPropagation(); var selection = self.get_selection(); @@ -1011,11 +1014,6 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. }); }, render: function () { - var self = this; - if (this.$current) { - this.$current.remove(); - } - this.$current = this.$_element.clone(true); this.$current.empty().append( QWeb.render('ListView.rows', _.extend({ render_cell: function () { @@ -1051,7 +1049,11 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. var row = cells.join(''); this.$current .children('tr:not([data-id])').remove().end() - .append(new Array(count - this.records.length + 1).join(row)); + .append(new Array(count - this.records.length + 1).join(row)).click( + function() { + $('button.oe_list_add').effect('bounce', {distance: 18, times: 5}, 150); + } + ); }, /** * Gets the ids of all currently selected records, if any @@ -1091,7 +1093,6 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. if (!this.$current) { return; } this.$current.remove(); this.$current = null; - this.$_element.remove(); }, get_records: function () { return this.records.map(function (record) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index b6b89a4f1ec..e34f3827dcf 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -650,9 +650,11 @@
- +
+ +
@@ -693,7 +695,7 @@ - + diff --git a/addons/web_graph/controllers/graph.py b/addons/web_graph/controllers/graph.py index f6c1343c042..1da5e3bc91f 100644 --- a/addons/web_graph/controllers/graph.py +++ b/addons/web_graph/controllers/graph.py @@ -53,6 +53,9 @@ class GraphView(View): if fields[field]['type']=='many2one': data = data and data[1] if tick: + if fields[field]['type']=='selection': + d = dict(fields[field]['selection']) + data = d[data] return ticks.setdefault(data, len(ticks)) return data or 0 diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 5f9f3027b65..e63f341c9dd 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -427,6 +427,10 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ this.$el.prepend( $('
').html(this.options.action.help) ); + var create_nocontent = this.$buttons; + this.$el.find('.oe_view_nocontent').click(function() { + create_nocontent.effect('bounce', {distance: 18, times: 5}, 150); + }); } });