[fix] when modify a record in a m2o, does not reload the name of the record

bzr revid: nicolas.vanhoren@openerp.com-20110713095352-qcbmhca6r4bvx1j3
This commit is contained in:
niv-openerp
2011-07-13 11:53:52 +02:00
parent b29106581f
commit 289ec3545b
+5
View File
@@ -1269,6 +1269,9 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({
}
var pop = new openerp.base.form.FormOpenPopup(null, self.view.session);
pop.show_element(self.field.relation, self.value[0],self.build_context(), {});
pop.on_write_completed.add_last(function() {
self.set_value(self.value[0]);
});
};
var cmenu = this.$menu_btn.contextMenu(this.cm_id, {'leftClickToo': true,
bindings: bindings, itemStyle: {"color": ""},
@@ -1976,8 +1979,10 @@ openerp.base.form.FormOpenPopup = openerp.base.BaseWidget.extend({
wdataset.parent_view = this.options.parent_view;
wdataset.write(id, data, function(r) {
self.stop();
self.on_write_completed();
});
},
on_write_completed: function() {},
setup_form_view: function() {
var self = this;
this.view_form = new openerp.base.FormView(null, this.session,