[fix] problem with the name_get in a m2o

lp bug: https://launchpad.net/bugs/896909 fixed

bzr revid: nicolas.vanhoren@openerp.com-20111220154145-wcxb87dfpseitgvj
This commit is contained in:
niv-openerp
2011-12-20 16:41:45 +01:00
parent 80c89004f7
commit 69bf67948a
+2 -1
View File
@@ -1922,7 +1922,8 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
self._change_int_ext_value(rval);
};
if (value && !(value instanceof Array)) {
var dataset = new openerp.web.DataSetStatic(this, this.field.relation, self.build_context());
// name_get in a m2o does not use the context of the field
var dataset = new openerp.web.DataSetStatic(this, this.field.relation, self.view.dataset.get_context());
dataset.name_get([value], function(data) {
real_set_value(data[0]);
}).fail(function() {self.tmp_value = undefined;});