diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-11-20 11:14:23 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-11-24 15:36:15 +0000 |
| commit | af14148b69ad1a7704a759e6ec33b035b88df8c9 (patch) | |
| tree | b68fd246ec1ba3bbc1f2c17417acf2e8578312b6 /addons/web/static/src/js | |
| parent | 478a42beb5876171afeab7df27fa69548edbf849 (diff) | |
[FIX] web: grouped export
- Create a product with:
Cost: 60.80
Quantity On Hand: 999.0
- Go to Inventory / Reporting / Inventory Report
- Export as XLS
The header values have too many decimals: 60739.2000000007
The root cause is `convert_to_cache` returns this value:
https://github.com/odoo/odoo/blob/042298f8c949fba470eda6ad90f94c95ca291030/odoo/fields.py#L1333
In this case, `currency.round()` keeps the extra digits. Since the field
is not stored, the useless digits are kept.
A simple solution is to use `float_repr` on the non-stored float fields
to make sure that doesn't happen. Another solution could be to not
convert the floats to strings, but that doesn't seem intended.
opw-2378895
closes odoo/odoo#62260
X-original-commit: 2ebcbb16f113dee1416097b7a52f8068a40a34cf
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/widgets/data_export.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js index 87900f9f0aa..0e10e56af80 100644 --- a/addons/web/static/src/js/widgets/data_export.js +++ b/addons/web/static/src/js/widgets/data_export.js @@ -118,6 +118,7 @@ var DataExport = Dialog.extend({ let exportedFields = this.defaultExportFields.map(field => ({ name: field, label: this.record.fields[field].string, + store: this.record.fields[field].store, })); this._exportData(exportedFields, 'xlsx', false); }, |
