e33baecfa3
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 |
||
---|---|---|
.. | ||
__init__.py | ||
expression.py | ||
fields.py | ||
orm.py | ||
osv.py | ||
query.py |