diff options
| author | Jiten (OpenERP) <jra@tinyerp.com> | 2012-10-23 13:03:38 +0530 |
|---|---|---|
| committer | Jiten (OpenERP) <jra@tinyerp.com> | 2012-10-23 13:03:38 +0530 |
| commit | af147e29c50e253e5145696fc41dce9de77db9ce (patch) | |
| tree | ed44a8669cf8f5c31c44232c9423daa56df77cae /addons/web/static/src/js | |
| parent | 17ce4c93b70b7e07059e306f57600dd2464d628f (diff) | |
| parent | c55438e695d03854ebf1b82aa0d6b33b3dc278f0 (diff) | |
[MERGE] Merged trunk.
bzr revid: jra@tinyerp.com-20121023073338-kq24ipesw0yo22sp
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 24 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 13 |
3 files changed, 19 insertions, 20 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 0bc2848fe0b..e279ade6fb3 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -135,6 +135,8 @@ instance.web.Query = instance.web.Class.extend({ }).pipe(function (results) { return _(results).map(function (result) { // FIX: querygroup initialization + result.__context = result.__context || {}; + result.__context.group_by = result.__context.group_by || []; _.defaults(result.__context, ctx); return new instance.web.QueryGroup( self._model.name, grouping[0], result); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bc171ef1d6e..850a334c40b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -168,7 +168,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.$buttons = $(QWeb.render("FormView.buttons", {'widget':self})); if (this.options.$buttons) { - this.options.$buttons.children().remove(); this.$buttons.appendTo(this.options.$buttons); } else { this.$el.find('.oe_form_buttons').replaceWith(this.$buttons); @@ -3120,8 +3119,10 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc if (!this.get("effective_readonly")) { this.$input.val(str.split("\n")[0]); this.current_display = this.$input.val(); - if(this.is_false()){ + if (this.is_false()) { this.$('.oe_m2o_cm_button').css({'display':'none'}); + } else { + this.$('.oe_m2o_cm_button').css({'display':'inline'}); } } else { var lines = _.escape(str).split("\n"); @@ -3351,23 +3352,13 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ controller.on('edit:before', self, function (e) { e.cancel = true; }); - var has_handle = _(controller.columns).find(function (column) { + _(controller.columns).find(function (column) { if (!column instanceof instance.web.list.Handle) { return false; } - column.modifiers.tree_invisible = true; - column.invisible = '1'; - // remove from visibles - controller.visible_columns.splice( - controller.visible_columns.indexOf(column), - 1); + column.modifiers.invisible = true; return true; }); - if (has_handle) { - // recompute aggregates - controller.aggregate_columns = - _(controller.visible_columns).invoke('to_aggregate'); - } } } else if (view_type === "form") { if (self.get("effective_readonly")) { @@ -4170,6 +4161,9 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend( } this._super(value_); }, + get_value: function() { + return [commands.replace_with(this.get('value'))]; + }, load_view: function() { var self = this; this.kanban_view = new instance.web.form.Many2ManyKanbanView(this, this.dataset, false, { @@ -4203,7 +4197,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend( }); }, dataset_changed: function() { - this.set({'value': [commands.replace_with(this.dataset.ids)]}); + this.set({'value': this.dataset.ids}); }, open_popup: function(type, unused) { if (type !== "form") diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index d4b676f2c7a..103ad7a2661 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -300,7 +300,6 @@ instance.web.ActionManager = instance.web.Widget.extend({ this.dialog_widget.destroy(); if (this.dialog === null || this.dialog.isDestroyed()) { this.dialog = new instance.web.Dialog(this, { - buttons: {"Close": function() {$(this).dialog("close")}}, dialogClass: executor.klass, }); this.dialog.on("closing", null, options.on_close); @@ -1068,9 +1067,11 @@ instance.web.Sidebar = instance.web.Widget.extend({ additional_context); result.flags = result.flags || {}; result.flags.new_window = true; - self.do_action(result, function () { - // reload view - self.getParent().reload(); + self.do_action(result, { + on_close: function() { + // reload view + self.getParent().reload(); + }, }); }); }); @@ -1216,7 +1217,9 @@ instance.web.View = instance.web.Widget.extend({ /* niv: previously we were overriding once more with action_data.context, * I assumed this was not a correct behavior and removed it */ - return self.do_action(action, result_handler); + return self.do_action(action, { + on_close: result_handler, + }); }, null); } else { return result_handler(); |
