reverted changes to o2m

bzr revid: nicolas.vanhoren@openerp.com-20121023125213-d7nc1282zmbvk72a
This commit is contained in:
niv-openerp 2012-10-23 14:52:13 +02:00
parent bb22e231ff
commit 94bc60b310
1 changed files with 5 additions and 20 deletions

View File

@ -3234,12 +3234,6 @@ var commands = {
return [6, false, ids];
}
};
/**
widget options:
- reload_on_button: Reload the whole form view if click on a button in a list view.
If you see this options, do not use it, it's basically a dirty hack to make one
precise o2m to behave the way we want.
*/
instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
multi_selection: false,
disable_utility_classes: true,
@ -3695,8 +3689,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
readonly: !this.is_action_enabled('edit') || self.o2m.get("effective_readonly")
});
},
handle_button: function(name, id, call) {
var _sup = _.bind(this._super, this);
do_button_action: function (name, id, callback) {
if (!_.isNumber(id)) {
instance.webclient.notification.warn(
_t("Action Button"),
@ -3707,22 +3700,14 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
var self = this;
this.ensure_saved().pipe(function () {
if (parent_form)
return parent_form.recursive_save();
return parent_form.save();
else
return $.when();
}).pipe(function () {
var call;
debugger;
if (! self.o2m.options.reload_on_button) {
call = callback;
} else {
call = function() {
self.o2m.view.recursive_reload();
};
}
_sup(name, id, call);
}).then(function () {
self.handle_button(name, id, callback);
});
},
_before_edit: function () {
this.__ignore_blur = false;
this.editor.form.on('blurred', this, this._on_form_blur);