From 5363cc4f0bd12e780d115ed09bff65c37e6a7652 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 4 Jul 2011 11:48:55 +0200 Subject: [PATCH] [fix] problem with on_change and parent bzr revid: nicolas.vanhoren@openerp.com-20110704094855-q2aytq7xna3nxftq --- addons/base/static/src/js/form.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index b92b4c53fef..7a2c704de72 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -176,7 +176,8 @@ openerp.base.FormView = openerp.base.View.extend( /** @lends openerp.base.FormV 'None' : function() {return null;}, 'context': function(i) { context_index = i; - return widget.build_context ? widget.build_context() : {}; + var ctx = widget.build_context ? widget.build_context() : {}; + return ctx; } } var parent_fields = null; @@ -197,7 +198,7 @@ openerp.base.FormView = openerp.base.View.extend( /** @lends openerp.base.FormV } var p_val = parent_fields[_.trim(splitted[1])]; if (p_val !== undefined) { - args.push(value ? value : false); + args.push(p_val == null ? false : p_val); return; } } @@ -442,7 +443,8 @@ openerp.base.FormView = openerp.base.View.extend( /** @lends openerp.base.FormV get_fields_values: function() { var values = {}; _.each(this.fields, function(value, key) { - values[key] = value.get_value(); + var val = value.get_value(); + values[key] = val; }); return values; }