[IMP] formatting of o2m and m2m fields in list views, courtesy of William Beltrán

backported from trunk revision xmo@openerp.com-20120607101329-aq0caswlxamd8z0n

lp bug: https://launchpad.net/bugs/942894 fixed

bzr revid: xmo@openerp.com-20120607103240-edk8759inv2jiw2q
This commit is contained in:
Xavier Morel 2012-06-07 12:32:40 +02:00
parent 300b3face2
commit bab4adf42b
1 changed files with 3 additions and 0 deletions

View File

@ -134,6 +134,9 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
case 'many2one':
// name_get value format
return value[1];
case 'one2many':
case 'many2many':
return _.str.sprintf(_t("(%d records)"), value.length);
case 'datetime':
if (typeof(value) == "string")
value = openerp.web.auto_str_to_date(value);