diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-12 19:03:00 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-12 19:03:00 +0100 |
| commit | 56974322f8c67ec5680654ed4bcb08ca57117c46 (patch) | |
| tree | e64c00274a47c46cf78e99b6ba62df4bc4dbbba4 /addons/web/static/src/js/fields/field_utils.js | |
| parent | f6ef0c776096774fc4c6821449ab42cfc2f53e62 (diff) | |
| parent | 3b80a059ff4305fe10c9b40a3118508b1b849ead (diff) | |
[MERGE] forward port branch 11.0 up to 3b80a059ff4
Diffstat (limited to 'addons/web/static/src/js/fields/field_utils.js')
| -rw-r--r-- | addons/web/static/src/js/fields/field_utils.js | 10 |
1 files changed, 5 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 812a7f380f7..5ac180b1de1 100644 --- a/addons/web/static/src/js/fields/field_utils.js +++ b/addons/web/static/src/js/fields/field_utils.js @@ -28,17 +28,17 @@ var _t = core._t; //------------------------------------------------------------------------------ /** + * Convert binary to bin_size * - * @param {string} value base64 representation of the binary + * @param {string} value base64 representation of the binary (might be already a bin_size!) * @param {Object} [field] * a description of the field (note: this parameter is ignored) * @param {Object} [options] additional options (note: this parameter is ignored) + * + * @returns {string} bin_size (which is human-readable) */ function formatBinary(value, field, options) { - if (!value) { - return ''; - } - return utils.human_size(value.length / 1.37); // base64 estimated size: http://en.wikipedia.org/wiki/Base64#MIME + return utils.binaryToBinsize(value); } /** |
