fix: create custom doctype from customize form
This commit is contained in:
parent
14f1850532
commit
4fecf0c07b
3 changed files with 8 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ frappe.listview_settings["DocType"] = {
|
|||
is_virtual = 0,
|
||||
is_single = 0,
|
||||
is_tree = 0,
|
||||
is_custom = 0,
|
||||
editable_grid = 1,
|
||||
} = args || {};
|
||||
|
||||
|
|
@ -81,7 +82,7 @@ frappe.listview_settings["DocType"] = {
|
|||
label: __("Custom?"),
|
||||
fieldname: "custom",
|
||||
fieldtype: "Check",
|
||||
default: non_developer,
|
||||
default: non_developer || is_custom,
|
||||
read_only: non_developer,
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ onMounted(() => selected.value && label_input.value.focus_on_label());
|
|||
<component
|
||||
:is="component"
|
||||
:df="field.df"
|
||||
:is-customize-form="store.is_customize_form"
|
||||
:data-fieldname="field.df.fieldname"
|
||||
:data-fieldtype="field.df.fieldtype"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { get_table_columns, load_doctype_model } from "../../utils";
|
||||
import { computedAsync } from "@vueuse/core";
|
||||
|
||||
const props = defineProps(["df"]);
|
||||
const props = defineProps(["df", "is-customize-form"]);
|
||||
|
||||
let table_columns = computedAsync(async () => {
|
||||
let doctype = props.df.options;
|
||||
|
|
@ -15,7 +15,10 @@ let table_columns = computedAsync(async () => {
|
|||
}, []);
|
||||
|
||||
function open_new_child_doctype_dialog() {
|
||||
frappe.listview_settings["DocType"].new_doctype_dialog({ is_child: 1 });
|
||||
let is_custom = props.isCustomizeForm;
|
||||
frappe.model.with_doctype("DocType").then(() => {
|
||||
frappe.listview_settings["DocType"].new_doctype_dialog({ is_child: 1, is_custom });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue