chore: fetch name only if first_document is checked
This commit is contained in:
parent
105f8d8bc7
commit
05bb38ea46
1 changed files with 2 additions and 2 deletions
|
|
@ -15,12 +15,12 @@ frappe.ui.form.on('Form Tour', {
|
|||
|
||||
frm.add_custom_button(__('Show Tour'), async () => {
|
||||
const issingle = await check_if_single(frm.doc.reference_doctype);
|
||||
const name = await get_first_document(frm.doc.reference_doctype);
|
||||
let route_changed = null;
|
||||
|
||||
|
||||
if (issingle) {
|
||||
route_changed = frappe.set_route('Form', frm.doc.reference_doctype);
|
||||
} else if (frm.doc.first_document) {
|
||||
const name = await get_first_document(frm.doc.reference_doctype);
|
||||
route_changed = frappe.set_route('Form', frm.doc.reference_doctype, name);
|
||||
} else {
|
||||
route_changed = frappe.set_route('Form', frm.doc.reference_doctype, 'new');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue