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

fix: Apply filters for derived doctype in defaults

This commit is contained in:
Faris Ansari 2019-10-19 20:06:53 +05:30
parent ab57eef2eb
commit a06828683a

View File

@ -104,10 +104,7 @@ module.exports = class BaseDocument extends Observable {
setDefaults() {
for (let field of this.meta.fields) {
if (
this[field.fieldname] === null ||
this[field.fieldname] === undefined
) {
if (this[field.fieldname] == null) {
let defaultValue = null;
if (field.fieldtype === 'Table') {
@ -120,6 +117,10 @@ module.exports = class BaseDocument extends Observable {
this[field.fieldname] = defaultValue;
}
}
if (this.meta.basedOn && this.meta.filters) {
this.setValues(this.meta.filters);
}
}
setKeywords() {