mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
fix: clearValues
This commit is contained in:
parent
46ec99199a
commit
f29157fb8f
@ -230,10 +230,11 @@ module.exports = class BaseDocument extends Observable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearValues() {
|
clearValues() {
|
||||||
for (let field of this.meta.getValidFields()) {
|
let toClear = ['_dirty', '_notInserted'].concat(
|
||||||
if (this[field.fieldname]) {
|
this.meta.getValidFields().map(df => df.fieldname)
|
||||||
delete this[field.fieldname];
|
);
|
||||||
}
|
for (let key of toClear) {
|
||||||
|
delete this[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user