[fix] fixed rare problem in the o2m when we try to get its value before it has finished refreshing

bzr revid: nicolas.vanhoren@openerp.com-20111012124923-zka6mskg56iha5wc
This commit is contained in:
niv-openerp 2011-10-12 14:49:23 +02:00
parent 0de588dd4a
commit 130e441133
1 changed files with 6 additions and 4 deletions

View File

@ -1937,9 +1937,10 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
if (this.dataset.index === null && this.dataset.ids.length >= 1) {
this.dataset.index = 0;
}
this.form_last_update.then(function() {
this.form_last_update = view.do_show();
});
var act = function() {
return view.do_show();
}
this.form_last_update = this.form_last_update.pipe(act, act);;
} else if (self.viewmanager.active_view === "graph") {
view.do_search(this.build_domain(), this.dataset.get_context(), []);
}
@ -2007,7 +2008,8 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
var self = this;
if (!this.dataset)
return [];
this.save_form_view();
if (!this.form_last_update.isResolved() && !this.form_last_update.isRejected())
this.save_form_view();
var val = this.dataset.delete_all ? [commands.delete_all()] : [];
val = val.concat(_.map(this.dataset.ids, function(id) {
var alter_order = _.detect(self.dataset.to_create, function(x) {return x.id === id;});