Changed the way of show the result in case of many2many and one2many fields according to xmo@openerp.com tips.

bzr revid: wbeltran@infostudio.com.ec-20120515132406-950ekkzyi3nq7jmp
This commit is contained in:
William Beltrán 2012-05-15 08:24:06 -05:00
parent dfba540117
commit 9e5290e997
1 changed files with 3 additions and 3 deletions

View File

@ -135,9 +135,9 @@ instance.web.format_value = function (value, descriptor, value_if_empty) {
// name_get value format // name_get value format
return value[1]; return value[1];
case 'one2many': case 'one2many':
// this is to show count of ids related in this o2m relation instead the list of them for example will show this:(5) instead of this 1,2,5,8,76 return _.str.sprintf(_t("(%d records)"), value.length);
count_ids = '('+value.length.toString()+')' case 'many2many':
return count_ids; return _.str.sprintf(_t("(%d records)"), value.length);
case 'datetime': case 'datetime':
if (typeof(value) == "string") if (typeof(value) == "string")
value = instance.web.auto_str_to_date(value); value = instance.web.auto_str_to_date(value);