mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
fix: clearValues
This commit is contained in:
parent
46ec99199a
commit
f29157fb8f
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user