Commit efb4d897 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Titouan Soulard

erp5_production_planning: fix copy issue from windows

parent 8d35ebd5
......@@ -132,7 +132,16 @@ function listenToInputPaste(matrixbox_container) {
e.stopPropagation();
e.preventDefault();
pasted_value = pasted_value.split('\n');
//libre office add "" at last line
if (pasted_value[pasted_value.length - 1] == '') {
pasted_value = pasted_value.slice(0, -1);
}
for (i = 0; i < pasted_value.length; i += 1) {
length = pasted_value[i].length;
//in windows, '\r' is added in the end of each line, remove it
if (pasted_value[i][pasted_value[i].length -1] == '\r') {
pasted_value[i] = pasted_value[i].slice(0, -1);
}
value_list = pasted_value[i].split(/\s+/);
tr = matrixbox.find('tr:eq(' + (tr_index + i) + ')');
for (j = 0; j < value_list.length; j += 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment