[FIX] some badly implemented function fields return empty strings (for e.g. dates, instead of False)
treat empty strings as 'false' except for char fields bzr revid: xmo@openerp.com-20111116100416-0713i9va49ffbzlh
This commit is contained in:
parent
4ea75b0da9
commit
e33b9a722e
|
@ -76,7 +76,13 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
|
|||
if (typeof value === 'number' && isNaN(value)) {
|
||||
value = false;
|
||||
}
|
||||
//noinspection FallthroughInSwitchStatementJS
|
||||
switch (value) {
|
||||
case '':
|
||||
if (descriptor.type === 'char') {
|
||||
return '';
|
||||
}
|
||||
console.warn('Field', descriptor, 'had an empty string as value, treating as false...');
|
||||
case false:
|
||||
case Infinity:
|
||||
case -Infinity:
|
||||
|
|
Loading…
Reference in New Issue