diff options
| author | fwi-odoo <fwi@odoo.com> | 2017-04-14 11:41:42 +0200 |
|---|---|---|
| committer | fwi-odoo <fwi@odoo.com> | 2017-04-19 17:42:21 +0200 |
| commit | 469feaa21d5828a6f398dfe0d25cad0f4b761510 (patch) | |
| tree | 65b2e04e4f1f23f35264179afca7c7f17359c289 /addons/web/static/src/js/fields/field_utils.js | |
| parent | 7b89b8853abce4dc2a120888409f96edfb92d5f5 (diff) | |
[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.
Diffstat (limited to 'addons/web/static/src/js/fields/field_utils.js')
| -rw-r--r-- | addons/web/static/src/js/fields/field_utils.js | 9 |
1 files changed, 4 insertions, 5 deletions
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, |
