fix(number_card): use get_meta to check if doctype is table
Not all users can query `DocType` table Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
248c1cf08b
commit
eeab774757
1 changed files with 5 additions and 1 deletions
|
|
@ -448,7 +448,11 @@ frappe.ui.form.on("Number Card", {
|
|||
let document_type = frm.doc.document_type;
|
||||
let doc_is_table =
|
||||
document_type &&
|
||||
(await frappe.db.get_value("DocType", document_type, "istable")).message.istable;
|
||||
(await new Promise((resolve) => {
|
||||
frappe.model.with_doctype(document_type, () => {
|
||||
resolve(frappe.get_meta(document_type).istable);
|
||||
});
|
||||
}));
|
||||
|
||||
frm.set_df_property("parent_document_type", "hidden", !doc_is_table);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue