brotherton-erpnext/erpnext/public/js/address.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
580 B
JavaScript
Raw Normal View History

// Copyright (c) 2016, Frappe Technologies and contributors
// For license information, please see license.txt
frappe.ui.form.on("Address", {
is_your_company_address: function(frm) {
frm.clear_table('links');
if(frm.doc.is_your_company_address) {
frm.add_child('links', {
link_doctype: 'Company',
link_name: frappe.defaults.get_user_default('Company')
});
frm.set_query('link_doctype', 'links', () => {
return {
filters: {
name: 'Company'
}
2020-10-14 12:54:51 +00:00
};
});
frm.refresh_field('links');
}
else {
frm.trigger('refresh');
}
}
});