[FIX] support many2one widget selection in tree

bzr revid: al@openerp.com-20111230164655-sfiha4rkbrqni4y0
This commit is contained in:
Antony Lesuisse 2011-12-30 17:46:55 +01:00
parent 3f8ca0c395
commit c02f2e0fbd
1 changed files with 3 additions and 0 deletions

View File

@ -125,6 +125,9 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
return value.format(l10n.time_format);
case 'selection':
// Each choice is [value, label]
if(_.isArray(value)) {
value = value[0]
}
var result = _(descriptor.selection).detect(function (choice) {
return choice[0] === value;
});