[FIX] web: float seen as changed with digits set to 0
Do not check float_is_zero for float fields with digits specifically set to 0, it means the rounding precision is infintie for those ones, and tmp === val is enough.
This commit is contained in:
parent
3171fd472e
commit
8121f29848
|
@ -469,9 +469,13 @@ openerp.PropertiesMixin = _.extend({}, openerp.EventDispatcherMixin, {
|
|||
if (tmp === val)
|
||||
return;
|
||||
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;
|
||||
var digits = self.field.digits;
|
||||
if (digits !== 0){
|
||||
digits = digits ? digits[1] : 2;
|
||||
if (openerp.web.float_is_zero(tmp - val, digits)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
changed = true;
|
||||
self.__getterSetterInternalMap[key] = val;
|
||||
|
|
Loading…
Reference in New Issue