2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix: Mark parentdoc as dirty if child is dirty

This commit is contained in:
Faris Ansari 2019-11-28 23:09:43 +05:30
parent ab51ce3122
commit 5273177768

View File

@ -73,6 +73,11 @@ module.exports = class BaseDocument extends Observable {
if (this[fieldname] !== value) {
this._dirty = true;
// if child is dirty, parent is dirty too
if (this.meta.isChild && this.parentdoc) {
this.parentdoc._dirty = true;
}
if (Array.isArray(value)) {
this[fieldname] = [];
for (let row of value) {