diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2015-07-07 09:50:18 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2015-07-07 19:17:43 +0200 |
| commit | e33baecfa3eff21a74a55f3b48b7a5cec99b9ddf (patch) | |
| tree | ec4ea5837679d1fc501e6070580e5404da670b5d /addons/analytic_user_function/analytic_user_function_view.xml | |
| parent | 2de301df2477d1f5f5cb76a98b6c5605271ec3e5 (diff) | |
[FIX] osv: binary size already in human format
In version 8.0, postgresql's pg_size_pretty function is used
(http://www.postgresql.org/docs/9.4/static/functions-admin.html) when
getting the size of a binary field when reading if `bin_size`
or `bin_size_[col_name]` is set in the context.
So in 8.0 the size of a binary field get units bytes, kB, MB, GB and TB
which was not taken into account. e.g: '5.3 GB'.
This fix uses the size of the string to choose to differenciate the two.
e.g: '10000 bytes' (the longest size) will be returned directly, but
for something longer the human size of the content length will be
returned.
There is a corner case if a file is shorter than 12 bytes but
it is an enough of a small scenario with small implications that it is
deemed acceptable.
closes #7485
opw-644085
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function_view.xml')
0 files changed, 0 insertions, 0 deletions
