fix: Create new button for dynamic links (#7511)
* fix: Create new button for dynamic links * fix: Use get_options for fetching options
This commit is contained in:
parent
78da23a7a1
commit
a873340d4e
1 changed files with 2 additions and 3 deletions
|
|
@ -168,13 +168,12 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
|
|||
}
|
||||
|
||||
if(!me.df.only_select) {
|
||||
if(frappe.model.can_create(doctype)
|
||||
&& me.df.fieldtype !== "Dynamic Link") {
|
||||
if(frappe.model.can_create(doctype)) {
|
||||
// new item
|
||||
r.results.push({
|
||||
label: "<span class='text-primary link-option'>"
|
||||
+ "<i class='fa fa-plus' style='margin-right: 5px;'></i> "
|
||||
+ __("Create a new {0}", [__(me.df.options)])
|
||||
+ __("Create a new {0}", [__(me.get_options())])
|
||||
+ "</span>",
|
||||
value: "create_new__link_option",
|
||||
action: me.new_doc
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue