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:
Deepesh Garg 2019-05-20 12:19:42 +05:30 committed by Faris Ansari
parent 78da23a7a1
commit a873340d4e

View file

@ -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