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

fix: clearValues

This commit is contained in:
Faris Ansari 2019-10-30 02:24:05 +05:30
parent 46ec99199a
commit f29157fb8f

View File

@ -230,10 +230,11 @@ module.exports = class BaseDocument extends Observable {
}
clearValues() {
for (let field of this.meta.getValidFields()) {
if (this[field.fieldname]) {
delete this[field.fieldname];
}
let toClear = ['_dirty', '_notInserted'].concat(
this.meta.getValidFields().map(df => df.fieldname)
);
for (let key of toClear) {
delete this[key];
}
}