mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
fix: DynamicLink Field
get error when create newDoc from DynamicLink field schemaName is undefined
This commit is contained in:
parent
01b29dc2a6
commit
6140909836
@ -73,6 +73,25 @@ export default {
|
|||||||
})
|
})
|
||||||
.filter(Boolean));
|
.filter(Boolean));
|
||||||
},
|
},
|
||||||
|
async openNewDoc() {
|
||||||
|
const schemaName = this.getTargetSchemaName();
|
||||||
|
if(!schemaName){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const name =
|
||||||
|
this.linkValue || fyo.doc.getTemporaryName(fyo.schemaMap[schemaName]);
|
||||||
|
const filters = await this.getCreateFilters();
|
||||||
|
const { openQuickEdit } = await import('src/utils/ui');
|
||||||
|
|
||||||
|
const doc = fyo.doc.getNewDoc(schemaName, { name, ...filters });
|
||||||
|
openQuickEdit({ doc });
|
||||||
|
|
||||||
|
doc.once('afterSync', () => {
|
||||||
|
this.$router.back();
|
||||||
|
this.results = [];
|
||||||
|
this.triggerChange(doc.name);
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user