[FIX] only reload m2m listview once after adding n records to it (via dialog)
The listview does not support concurrent reload requests, either wait for the previous reload to finish before sending the new one, or just send a single reload. For m2m, can wait and do a single reload so do that. bzr revid: xmo@openerp.com-20121018134123-ox2ccq0wm3r5jwas
This commit is contained in:
parent
f910bc6780
commit
6782c33a32
|
@ -4048,13 +4048,17 @@ instance.web.form.Many2ManyListView = instance.web.ListView.extend(/** @lends in
|
||||||
);
|
);
|
||||||
var self = this;
|
var self = this;
|
||||||
pop.on("elements_selected", self, function(element_ids) {
|
pop.on("elements_selected", self, function(element_ids) {
|
||||||
_.each(element_ids, function(one_id) {
|
var reload = false;
|
||||||
if(! _.detect(self.dataset.ids, function(x) {return x == one_id;})) {
|
_(element_ids).each(function (id) {
|
||||||
self.dataset.set_ids([].concat(self.dataset.ids, [one_id]));
|
if(! _.detect(self.dataset.ids, function(x) {return x == id;})) {
|
||||||
|
self.dataset.set_ids(self.dataset.ids.concat([id]));
|
||||||
self.m2m_field.dataset_changed();
|
self.m2m_field.dataset_changed();
|
||||||
self.reload_content();
|
reload = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (reload) {
|
||||||
|
self.reload_content();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
do_activate_record: function(index, id) {
|
do_activate_record: function(index, id) {
|
||||||
|
|
Loading…
Reference in New Issue