fix: redirect and open new doctype dialog if route to /doctype/new
This commit is contained in:
parent
21d7cbca41
commit
f98af2e67a
1 changed files with 7 additions and 2 deletions
|
|
@ -85,8 +85,13 @@ export const useStore = defineStore("form-builder-store", () => {
|
|||
|
||||
async function fetch() {
|
||||
doc.value = frm.value.doc;
|
||||
if (doctype.value.startsWith("new-doctype-") && !doc.value.fields) {
|
||||
doc.value.fields = [get_df("Data", "", __("Title"))];
|
||||
if (doctype.value.startsWith("new-doctype-") && !doc.value.fields?.length) {
|
||||
frappe.model.with_doctype("DocType").then(() => {
|
||||
frappe.listview_settings["DocType"].new_doctype_dialog();
|
||||
});
|
||||
// redirect to /doctype
|
||||
frappe.set_route("List", "DocType");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!get_docfields.value.length) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue