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:
parent
ab57eef2eb
commit
a06828683a
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user