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:
var tmp = Number(value);
if (!isNaN(tmp))
return tmp;
- tmp = value.replace(openerp.web._t.database.parameters.decimal_point, ".");
- var tmp2 = tmp;
+
+ var tmp2 = value;
do {
tmp = tmp2;
tmp2 = tmp.replace(openerp.web._t.database.parameters.thousands_sep, "");
} while(tmp !== tmp2);
- tmp = Number(tmp);
- if (isNaN(tmp))
+ var reformatted_value = tmp.replace(openerp.web._t.database.parameters.decimal_point, ".");
+ var parsed = Number(reformatted_value);
+ if (isNaN(parsed))
throw new Error(value + " is not a correct float");
- return tmp;
+ return parsed;
case 'float_time':
var float_time_pair = value.split(":");
if (float_time_pair.length != 2)
if (column.tag === 'button') {
return [
'<button type="button" title="', column.string || '', '">',
- '<img src="/web/static/src/img/icons/', column.icon, '.png"',
+ '<img src="', openerp.connection.prefix, '/web/static/src/img/icons/', column.icon, '.png"',
' alt="', column.string || '', '"/>',
'</button>'
].join('')