[ADD] display of selection fields in format_value
bzr revid: xmo@openerp.com-20111012120938-9lpxm6mf8jbde6oj
This commit is contained in:
parent
177ca871c9
commit
eb796396e0
|
@ -69,6 +69,13 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return value.format("%H:%M:%S");
|
return value.format("%H:%M:%S");
|
||||||
}
|
}
|
||||||
|
case 'selection':
|
||||||
|
// Each choice is [value, label]
|
||||||
|
var result = _(descriptor.selection).detect(function (choice) {
|
||||||
|
return choice[0] === value;
|
||||||
|
});
|
||||||
|
if (result) { return result[1]; }
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue