From bab4adf42b9cd208768e00fbd1dcfa9cabd6e057 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 7 Jun 2012 12:32:40 +0200 Subject: [PATCH] =?UTF-8?q?[IMP]=20formatting=20of=20o2m=20and=20m2m=20fie?= =?UTF-8?q?lds=20in=20list=20views,=20courtesy=20of=20William=20Beltr?= =?UTF-8?q?=C3=A1n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit backported from trunk revision xmo@openerp.com-20120607101329-aq0caswlxamd8z0n lp bug: https://launchpad.net/bugs/942894 fixed bzr revid: xmo@openerp.com-20120607103240-edk8759inv2jiw2q --- addons/web/static/src/js/formats.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 53863e63e97..b45dfb8ab40 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -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);