mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
feat: add make methods for Bank Account (#49000)
* perf(make_bank_account): remove useless roundtrip to server * feat: add make methods for Bank Account Auto-fill Party Type and Party when creating a Bank Account from Customer, Supplier or Employee.
This commit is contained in:
@@ -64,6 +64,10 @@ frappe.ui.form.on("Supplier", {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frm.make_methods = {
|
||||||
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
|
|||||||
@@ -213,17 +213,9 @@ $.extend(erpnext.utils, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
make_bank_account: function (doctype, docname) {
|
make_bank_account: function (doctype, docname) {
|
||||||
frappe.call({
|
frappe.new_doc("Bank Account", {
|
||||||
method: "erpnext.accounts.doctype.bank_account.bank_account.make_bank_account",
|
party_type: doctype,
|
||||||
args: {
|
party: docname,
|
||||||
doctype: doctype,
|
|
||||||
docname: docname,
|
|
||||||
},
|
|
||||||
freeze: true,
|
|
||||||
callback: function (r) {
|
|
||||||
var doclist = frappe.model.sync(r.message);
|
|
||||||
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ frappe.ui.form.on("Customer", {
|
|||||||
frm: frm,
|
frm: frm,
|
||||||
}),
|
}),
|
||||||
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
||||||
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
};
|
};
|
||||||
|
|
||||||
frm.add_fetch("lead_name", "company_name", "customer_name");
|
frm.add_fetch("lead_name", "company_name", "customer_name");
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ erpnext.setup.EmployeeController = class EmployeeController extends frappe.ui.fo
|
|||||||
};
|
};
|
||||||
|
|
||||||
frappe.ui.form.on("Employee", {
|
frappe.ui.form.on("Employee", {
|
||||||
|
setup: function (frm) {
|
||||||
|
frm.make_methods = {
|
||||||
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
onload: function (frm) {
|
onload: function (frm) {
|
||||||
frm.set_query("department", function () {
|
frm.set_query("department", function () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user