summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>2012-10-23 17:48:13 +0530
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>2012-10-23 17:48:13 +0530
commitefddb3a904b824ca4d4e966909b283350a0b8892 (patch)
tree13b8f2aed84ef7099049eed01053df6ba790d5a0 /addons/web/static/src/js
parentedc3869ca2004251d13d1908526fc4e0290923cd (diff)
parente106b1cff8c85bf93e001a5b3165069ea5317cef (diff)
[MERGE] merge lp:~openerp-dev/openerp-web/trunk-improve-css-printing.
bzr revid: bth@tinyerp.com-20121023121813-ivw4e4sfxp3x75y5
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/data.js2
-rw-r--r--addons/web/static/src/js/view_form.js24
-rw-r--r--addons/web/static/src/js/views.js13
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();