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

bzr revid: xmo@openerp.com-20120607101329-aq0caswlxamd8z0n
This commit is contained in:
Xavier Morel 2012-06-07 12:13:29 +02:00
commit 7c8ed0a00c
1 changed files with 3 additions and 0 deletions

View File

@ -134,6 +134,9 @@ instance.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 = instance.web.auto_str_to_date(value);