2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 23:00:56 +00:00

fix: DynamicLink Field

get error when create newDoc from DynamicLink field
schemaName is undefined
This commit is contained in:
Abdallah A. Zaqout 2023-06-22 13:26:25 -07:00 committed by Alan
parent 01b29dc2a6
commit 6140909836

View File

@ -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>