From 69bf67948ac6ff366c934a5ab479744784c23661 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 20 Dec 2011 16:41:45 +0100 Subject: [PATCH] [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 --- addons/web/static/src/js/view_form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 5c503160e34..06317df8e26 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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;});