Skip to content

Commit

Permalink
fix: redirect and open new doctype dialog if route to /doctype/new
Browse files Browse the repository at this point in the history
(cherry picked from commit f98af2e)
  • Loading branch information
shariquerik authored and mergify[bot] committed Feb 3, 2024
1 parent 474feb8 commit fec821a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frappe/public/js/form_builder/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fec821a

Please sign in to comment.