refactor: remove frappe.dynamic_link (#35096)
This commit is contained in:
parent
872a23c77d
commit
bf84e0d441
@ -8,9 +8,6 @@ frappe.ui.form.on('Bank', {
|
|||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
add_fields_to_mapping_table(frm);
|
add_fields_to_mapping_table(frm);
|
||||||
|
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank' };
|
|
||||||
|
|
||||||
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||||
|
|
||||||
if (frm.doc.__islocal) {
|
if (frm.doc.__islocal) {
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Shareholder', {
|
frappe.ui.form.on('Shareholder', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Shareholder' };
|
|
||||||
|
|
||||||
frm.toggle_display(['contact_html'], !frm.doc.__islocal);
|
frm.toggle_display(['contact_html'], !frm.doc.__islocal);
|
||||||
|
|
||||||
if (frm.doc.__islocal) {
|
if (frm.doc.__islocal) {
|
||||||
|
|||||||
@ -66,8 +66,6 @@ frappe.ui.form.on("Supplier", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Supplier' }
|
|
||||||
|
|
||||||
if (frappe.defaults.get_default("supp_master_name") != "Naming Series") {
|
if (frappe.defaults.get_default("supp_master_name") != "Naming Series") {
|
||||||
frm.toggle_display("naming_series", false);
|
frm.toggle_display("naming_series", false);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -30,11 +30,6 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
|
|||||||
var me = this;
|
var me = this;
|
||||||
let doc = this.frm.doc;
|
let doc = this.frm.doc;
|
||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
frappe.dynamic_link = {
|
|
||||||
doc: doc,
|
|
||||||
fieldname: 'name',
|
|
||||||
doctype: 'Lead'
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!this.frm.is_new() && doc.__onload && !doc.__onload.is_customer) {
|
if (!this.frm.is_new() && doc.__onload && !doc.__onload.is_customer) {
|
||||||
this.frm.add_custom_button(__("Customer"), this.make_customer, __("Create"));
|
this.frm.add_custom_button(__("Customer"), this.make_customer, __("Create"));
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Prospect', {
|
frappe.ui.form.on('Prospect', {
|
||||||
refresh (frm) {
|
refresh (frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: "name", doctype: frm.doctype };
|
|
||||||
|
|
||||||
if (!frm.is_new() && frappe.boot.user.can_create.includes("Customer")) {
|
if (!frm.is_new() && frappe.boot.user.can_create.includes("Customer")) {
|
||||||
frm.add_custom_button(__("Customer"), function() {
|
frm.add_custom_button(__("Customer"), function() {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
|
|||||||
@ -131,8 +131,6 @@ frappe.ui.form.on("Customer", {
|
|||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
}
|
}
|
||||||
|
|
||||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Customer'}
|
|
||||||
|
|
||||||
if(!frm.doc.__islocal) {
|
if(!frm.doc.__islocal) {
|
||||||
frappe.contacts.render_address_and_contact(frm);
|
frappe.contacts.render_address_and_contact(frm);
|
||||||
|
|
||||||
|
|||||||
@ -81,8 +81,6 @@ frappe.ui.form.on("Company", {
|
|||||||
disbale_coa_fields(frm);
|
disbale_coa_fields(frm);
|
||||||
frappe.contacts.render_address_and_contact(frm);
|
frappe.contacts.render_address_and_contact(frm);
|
||||||
|
|
||||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Company'}
|
|
||||||
|
|
||||||
if (frappe.perm.has_perm("Cost Center", 0, 'read')) {
|
if (frappe.perm.has_perm("Cost Center", 0, 'read')) {
|
||||||
frm.add_custom_button(__('Cost Centers'), function() {
|
frm.add_custom_button(__('Cost Centers'), function() {
|
||||||
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
|
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Sales Partner', {
|
frappe.ui.form.on('Sales Partner', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Sales Partner'}
|
|
||||||
|
|
||||||
if(frm.doc.__islocal){
|
if(frm.doc.__islocal){
|
||||||
hide_field(['address_html', 'contact_html', 'address_contacts']);
|
hide_field(['address_html', 'contact_html', 'address_contacts']);
|
||||||
frappe.contacts.clear_address_and_contact(frm);
|
frappe.contacts.clear_address_and_contact(frm);
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Manufacturer', {
|
frappe.ui.form.on('Manufacturer', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Manufacturer' };
|
|
||||||
if (frm.doc.__islocal) {
|
if (frm.doc.__islocal) {
|
||||||
hide_field(['address_html','contact_html']);
|
hide_field(['address_html','contact_html']);
|
||||||
frappe.contacts.clear_address_and_contact(frm);
|
frappe.contacts.clear_address_and_contact(frm);
|
||||||
|
|||||||
@ -83,12 +83,6 @@ frappe.ui.form.on("Warehouse", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
frm.toggle_enable(["is_group", "company"], false);
|
frm.toggle_enable(["is_group", "company"], false);
|
||||||
|
|
||||||
frappe.dynamic_link = {
|
|
||||||
doc: frm.doc,
|
|
||||||
fieldname: "name",
|
|
||||||
doctype: "Warehouse",
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user