forked from Techsystech/web
[FIX] web_export_view: Several things:
* Retrieve all columns even if they are not sortable. Prevent to get select record column * Prevent to process float time numbers as real numbers during the export12.0
parent
5be4d84cac
commit
4a7f6c23bc
|
@ -42,11 +42,13 @@ odoo.define('web_export_view', function (require) {
|
|||
var export_columns_keys = [];
|
||||
var export_columns_names = [];
|
||||
var column_index = 0;
|
||||
var column_header_selector;
|
||||
$.each(view.renderer.columns, function () {
|
||||
if (this.tag == 'field' && (this.attrs.widget === undefined || this.attrs.widget != 'handle')) {
|
||||
// non-fields like `_group` or buttons
|
||||
export_columns_keys.push(column_index);
|
||||
export_columns_names.push(view.$el.find('.o_list_view > thead > tr> th[title]:eq('+column_index+')')[0].textContent);
|
||||
column_header_selector = '.o_list_view > thead > tr> th:not([class*="o_list_record_selector"]):eq('+column_index+')';
|
||||
export_columns_names.push(view.$el.find(column_header_selector)[0].textContent);
|
||||
}
|
||||
column_index ++;
|
||||
});
|
||||
|
@ -69,7 +71,11 @@ odoo.define('web_export_view', function (require) {
|
|||
}
|
||||
else {
|
||||
var text = $cell.text().trim();
|
||||
if ($cell.hasClass("o_list_number")) {
|
||||
var is_number = (
|
||||
$cell.hasClass('o_list_number') &&
|
||||
!$cell.hasClass('o_float_time_cell')
|
||||
);
|
||||
if (is_number) {
|
||||
export_row.push(parseFloat(
|
||||
text
|
||||
// Remove thousands separator
|
||||
|
@ -80,8 +86,7 @@ odoo.define('web_export_view', function (require) {
|
|||
// Remove non-numeric characters
|
||||
.replace(/[^\d\.-]/g, "")
|
||||
));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
export_row.push(text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue