fix: Create new button for dynamic link fields (#7510)

* 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:22 +05:30 committed by Faris Ansari
parent 4e501f931e
commit 90bc741c98

View file

@ -167,13 +167,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