From 4fb28eeb718c9d71432ef9b78f7c8181f52e8aa6 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 10 Jun 2011 15:29:26 +0200 Subject: [PATCH] [imp] improved floating state handling bzr revid: nicolas.vanhoren@openerp.com-20110610132926-2kvljjzeezj24gjp --- addons/base/static/src/js/form.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 2308aa1ba79..bf7382f3dd9 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -1171,9 +1171,10 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ } }, get_value: function() { - return this.value !== undefined ? - (this.value !== null ? this.value[0] : null) : undefined; - }, + if (this.value === undefined) + throw "theorically unreachable state"; + return this.value ? this.value[0] : null; + } //TODO niv: add validation });