2
0
mirror of https://github.com/frappe/books.git synced 2025-01-12 02:59:11 +00:00

fix: Renumber rows when they are changed

This commit is contained in:
Faris Ansari 2020-02-03 23:25:44 +05:30
parent 6076b4f966
commit 1980e5e26f

View File

@ -75,9 +75,10 @@ module.exports = class BaseDocument extends Observable {
if (Array.isArray(value)) {
this[fieldname] = [];
for (let row of value) {
value.forEach((row, i) => {
this.append(fieldname, row);
}
row.idx = i;
});
} else {
await this.validateField(fieldname, value);
this[fieldname] = value;