[fix] problem with the name_get in a m2o
authorniv-openerp <nicolas.vanhoren@openerp.com>
Tue, 20 Dec 2011 15:41:45 +0000 (16:41 +0100)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Tue, 20 Dec 2011 15:41:45 +0000 (16:41 +0100)
lp bug: https://launchpad.net/bugs/896909 fixed

bzr revid: nicolas.vanhoren@openerp.com-20111220154145-wcxb87dfpseitgvj

addons/web/static/src/js/view_form.js

index 5c50316..06317df 100644 (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;});