[FIX] web: field on change event

This is related to rev. d17f22cde7

Compare float values using float_is_zeor only
if the key is 'value',
meaning the changed value is the actual value of the field,
not another variable of the field (widget, etc.)

For instance, changing the currency_info of a float field
using the monetary widget should not compare the old and new value using
float_is_zero (the values are not even floats).

opw-627166
This commit is contained in:
Denis Ledoux 2015-02-04 12:58:19 +01:00
parent c3c7aa79a0
commit 3636aeb59d
1 changed files with 1 additions and 1 deletions

View File

@ -468,7 +468,7 @@ openerp.PropertiesMixin = _.extend({}, openerp.EventDispatcherMixin, {
var tmp = self.__getterSetterInternalMap[key];
if (tmp === val)
return;
if (self.field && self.field.type === 'float' && tmp && val){
if (key === 'value' && self.field && self.field.type === 'float' && tmp && val){
var precision = self.field.digits ? self.field.digits[1] : 2;
if (openerp.web.float_is_zero(tmp - val, precision))
return;