Dear all, I want add another field to this form (to the marked area) from the opportunity doctype, any idea?
Thank you,
Ramaly
Dear all, I want add another field to this form (to the marked area) from the opportunity doctype, any idea?
Thank you,
Ramaly
Go to Customize Form from the Awesome Bar, Input the name of the concerned Doctype and from their, you will be able to add the new field. Save the field and then use edit link, followed by “Move” to place the new field wherever you want it on the form.
Hi @Otunba, this is not related to a normal form but “Get Items from” dialog pop up which doesnt give any customization options. any idea?
In that case, I have no further idea.
Dear @ramalyb,
Were you able to find a solution? How can we include columns that are not in the current form but are present in Opportunities? Additionally, is it possible to add fields from the Opportunities Items table?
Hi @ramalyb , I have done this customization but need to go through the code let me get back to you once i find it.
Hi @ramalyb :
This form is built with MultiSelectDialog
Check this docs
https://docs.frappe.io/framework/user/en/api/dialog#frappeuiformmultiselectdialog
And dive the code …
Hope this helps.
Hello, Below is the code how you can add additional field inside “Get Items From” Dialog box. This logic i wrote for Sales Invoice file. But it could be for Opportunity as well.
// File path could be inside custom_app/public/js/sales_invoice.js
frappe.provide('erpnext.accounts');
// Extend the Sales Invoice Controller
erpnext.accounts.SalesInvoiceController = class CustomSalesInvoiceController extends erpnext.accounts.SalesInvoiceController {
sales_order_btn() {
var me = this;
this.$sales_order_btn = this.frm.add_custom_button(
__("Sales Order"),
function () {
erpnext.utils.map_current_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", // Add your custom methods if needed
source_doctype: "Sales Order",
target: me.frm,
setters: {
customer: me.frm.doc.customer || undefined,
naming_series: me.frm.naming_series // You can write any field you wanted to
},
get_query_filters: {
docstatus: 1,
status: ["not in", ["Closed", "On Hold"]],
per_billed: ["<", 99.99],
company: me.frm.doc.company,
},
});
},
__("Get Items From")
);
}
}
// Extend the Sales Invoice Form
extend_cscript(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({frm: cur_frm}));
// Mention Doctype inside hooks.py file.
doctype_js = {
"Sales Invoice": "public/js/sales_invoice.js"
}