feat: request_for_quotation - refactor
- Set supplier as link in while selecting supplier to create quotation
This commit is contained in:
parent
b226e7d2ac
commit
04c96b547e
@ -92,17 +92,19 @@ frappe.ui.form.on("Request for Quotation",{
|
|||||||
var dialog = new frappe.ui.Dialog({
|
var dialog = new frappe.ui.Dialog({
|
||||||
title: __("Create Supplier Quotation"),
|
title: __("Create Supplier Quotation"),
|
||||||
fields: [
|
fields: [
|
||||||
{ "fieldtype": "Select", "label": __("Supplier"),
|
{ "fieldtype": "Link",
|
||||||
|
"label": __("Supplier"),
|
||||||
"fieldname": "supplier",
|
"fieldname": "supplier",
|
||||||
"options": doc.suppliers.map(d => {
|
"options": 'Supplier',
|
||||||
if (d.supplier !== d.supplier_name){
|
|
||||||
return `${d.supplier_name} [${d.supplier}]`
|
|
||||||
}else {
|
|
||||||
return d.supplier
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"default": doc.suppliers.length === 1 ? doc.suppliers[0].supplier_name : "" },
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters: [
|
||||||
|
["Supplier", "name", "in", frm.doc.suppliers.map((row) => {return row.supplier;})]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
],
|
],
|
||||||
primary_action_label: __("Create"),
|
primary_action_label: __("Create"),
|
||||||
primary_action: (args) => {
|
primary_action: (args) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user