mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 06:59:20 +00:00
perf: create Pricing Rule from Customer and Supplier
This commit is contained in:
@@ -67,7 +67,7 @@ frappe.ui.form.on("Supplier", {
|
|||||||
|
|
||||||
frm.make_methods = {
|
frm.make_methods = {
|
||||||
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
"Pricing Rule": () => frm.trigger("make_pricing_rule"),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ frappe.ui.form.on("Supplier", {
|
|||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
__("Pricing Rule"),
|
__("Pricing Rule"),
|
||||||
function () {
|
function () {
|
||||||
erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name);
|
frm.trigger("make_pricing_rule");
|
||||||
},
|
},
|
||||||
__("Create")
|
__("Create")
|
||||||
);
|
);
|
||||||
@@ -230,4 +230,11 @@ frappe.ui.form.on("Supplier", {
|
|||||||
});
|
});
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
|
make_pricing_rule: function (frm) {
|
||||||
|
frappe.new_doc("Pricing Rule", {
|
||||||
|
applicable_for: "Supplier",
|
||||||
|
supplier: frm.doc.name,
|
||||||
|
buying: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ frappe.ui.form.on("Customer", {
|
|||||||
method: "erpnext.selling.doctype.customer.customer.make_payment_entry",
|
method: "erpnext.selling.doctype.customer.customer.make_payment_entry",
|
||||||
frm: frm,
|
frm: frm,
|
||||||
}),
|
}),
|
||||||
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
"Pricing Rule": () => frm.trigger("make_pricing_rule"),
|
||||||
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
"Bank Account": () => erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -264,4 +264,11 @@ frappe.ui.form.on("Customer", {
|
|||||||
});
|
});
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
|
make_pricing_rule: function (frm) {
|
||||||
|
frappe.new_doc("Pricing Rule", {
|
||||||
|
applicable_for: "Customer",
|
||||||
|
customer: frm.doc.name,
|
||||||
|
selling: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user