forked from Techsystech/web
Merge pull request #592 from Tecnativa/9.0-web_export_view-no_currency
[FIX][web_export_view] Remove monetary formatting9.0
commit
73ca05a805
|
@ -73,23 +73,24 @@ Sidebar.include({
|
||||||
var checked = $row.find(row_selector).is(':checked');
|
var checked = $row.find(row_selector).is(':checked');
|
||||||
if (children && checked === true) {
|
if (children && checked === true) {
|
||||||
$.each(export_columns_keys, function () {
|
$.each(export_columns_keys, function () {
|
||||||
var cell = $row.find('td[data-field="' + this + '"]').get(0);
|
var $cell = $row.find('td[data-field="' + this + '"]');
|
||||||
var text = cell.text || cell.textContent || cell.innerHTML || "";
|
var text = $cell.text();
|
||||||
if (cell.classList.contains("oe_list_field_float")) {
|
if ($cell.hasClass("oe_list_field_monetary")) {
|
||||||
|
// Remove all but digits, dots and commas
|
||||||
|
text = text.replace(/[^\d\.,]/g, "");
|
||||||
|
export_row.push(
|
||||||
|
formats.parse_value(text, {"type": "monetary"})
|
||||||
|
);
|
||||||
|
} else if ($cell.hasClass("oe_list_field_float")) {
|
||||||
export_row.push(
|
export_row.push(
|
||||||
formats.parse_value(text, {'type': "float"})
|
formats.parse_value(text, {'type': "float"})
|
||||||
);
|
);
|
||||||
}
|
} else if ($cell.hasClass("oe_list_field_boolean")) {
|
||||||
else if (cell.classList.contains("oe_list_field_boolean")) {
|
export_row.push(
|
||||||
var data_id = $('<div>' + cell.innerHTML + '</div>');
|
$cell.is(':has(input:checked)')
|
||||||
if (data_id.find('input').get(0).checked) {
|
? _t("True") : _t("False")
|
||||||
export_row.push(_t("True"));
|
);
|
||||||
}
|
} else if ($cell.hasClass("oe_list_field_integer")) {
|
||||||
else {
|
|
||||||
export_row.push(_t("False"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (cell.classList.contains("oe_list_field_integer")) {
|
|
||||||
var tmp, tmp2 = text;
|
var tmp, tmp2 = text;
|
||||||
do {
|
do {
|
||||||
tmp = tmp2;
|
tmp = tmp2;
|
||||||
|
@ -100,8 +101,7 @@ Sidebar.include({
|
||||||
} while (tmp !== tmp2);
|
} while (tmp !== tmp2);
|
||||||
|
|
||||||
export_row.push(parseInt(tmp2));
|
export_row.push(parseInt(tmp2));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
export_row.push(text.trim());
|
export_row.push(text.trim());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue