mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-18 00:48:42 +00:00
feat(selling): add a New button below the proforma listing
Place a "+ New" button under the Proforma tab list to create another proforma without leaving the tab.
This commit is contained in:
@@ -243,9 +243,9 @@ Object.assign(erpnext.proforma, {
|
||||
},
|
||||
|
||||
build_list(frm) {
|
||||
const wrapper = frm.get_field("proforma_html").$wrapper.empty();
|
||||
const container = frm.get_field("proforma_html").$wrapper.empty();
|
||||
const list = new frappe.ui.EmbeddedList({
|
||||
wrapper,
|
||||
wrapper: $("<div></div>").appendTo(container),
|
||||
doctype: "Proforma Invoice",
|
||||
// Include cancelled (docstatus 2) so voided proformas stay visible for audit.
|
||||
filters: { sales_order: frm.doc.name, docstatus: ["in", [1, 2]] },
|
||||
@@ -297,6 +297,18 @@ Object.assign(erpnext.proforma, {
|
||||
],
|
||||
});
|
||||
list.refresh();
|
||||
|
||||
frappe.ui
|
||||
.button({
|
||||
label: __("New Proforma"),
|
||||
icon: "plus",
|
||||
variant: "subtle",
|
||||
size: "sm",
|
||||
onclick: () => this.open_dialog(frm),
|
||||
})
|
||||
.appendTo(
|
||||
$('<div class="flex justify-end" style="margin: 10px 0 20px;"></div>').appendTo(container)
|
||||
);
|
||||
},
|
||||
|
||||
send_email(frm, proforma_name, refresh) {
|
||||
|
||||
Reference in New Issue
Block a user