From f994797896e767e489b88d3e8644cd95f62d848b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Beltr=C3=A1n?= Date: Fri, 4 May 2012 12:23:03 -0500 Subject: [PATCH] [FIX]: Bug #942894 This fix the format.js file to make openerp show a count of ids instead the list of them in 2om relationship. lp bug: https://launchpad.net/bugs/942894 fixed bzr revid: wbeltran@infostudio.com.ec-20120504172303-r4pynkj4vofeptk5 --- addons/web/static/src/js/formats.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 640ba4d5a93..834a73fac2a 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -134,6 +134,10 @@ instance.web.format_value = function (value, descriptor, value_if_empty) { case 'many2one': // name_get value format return value[1]; + 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 + count_ids='('+value.length.toString()+')' + return count_ids; case 'datetime': if (typeof(value) == "string") value = instance.web.auto_str_to_date(value);