2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +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() { 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];
} }
} }