From 469feaa21d5828a6f398dfe0d25cad0f4b761510 Mon Sep 17 00:00:00 2001 From: fwi-odoo Date: Fri, 14 Apr 2017 11:41:42 +0200 Subject: [FIX] web: call the correct format method for the one2many in list view The one2many fields in list view should render the number of record, like the many2many fields. --- addons/web/static/src/js/fields/field_utils.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src/js/fields/field_utils.js') diff --git a/addons/web/static/src/js/fields/field_utils.js b/addons/web/static/src/js/fields/field_utils.js index b00fca0048a..534ae68bbf5 100644 --- a/addons/web/static/src/js/fields/field_utils.js +++ b/addons/web/static/src/js/fields/field_utils.js @@ -190,14 +190,13 @@ function formatMany2one(value) { } /** - * Returns a string representing an many2one. That is a string containing all - * the display_name, concatenated. + * Returns a string indicating the number of records in the relation. * * @param {Object} value a valid element from a BasicModel, that represents a * list of values * @returns {string} */ -function formatMany2Many(value) { +function formatX2Many(value) { if (value.data.length === 0) { return _t('No records'); } else if (value.data.length === 1) { @@ -446,10 +445,10 @@ return { float_time: formatFloatTime, html: _.identity, // todo integer: formatInteger, - many2many: formatMany2Many, + many2many: formatX2Many, many2one: formatMany2one, monetary: formatMonetary, - one2many: _.identity, // todo + one2many: formatX2Many, reference: _.identity, // todo selection: formatSelection, text: formatChar, -- cgit v1.2.3