Skip to content

Commit

Permalink
feat: request_for_quotation - refactor
Browse files Browse the repository at this point in the history
- Set supplier as link in while selecting supplier to create quotation

(cherry picked from commit 04c96b5)
  • Loading branch information
ahmadpak authored and mergify[bot] committed May 13, 2022
1 parent db4e264 commit b6a3e69
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,19 @@ frappe.ui.form.on("Request for Quotation",{
var dialog = new frappe.ui.Dialog({
title: __("Create Supplier Quotation"),
fields: [
{ "fieldtype": "Select", "label": __("Supplier"),
{ "fieldtype": "Link",
"label": __("Supplier"),
"fieldname": "supplier",
"options": doc.suppliers.map(d => {
if (d.supplier !== d.supplier_name){
return `${d.supplier_name} [${d.supplier}]`
}else {
return d.supplier
}
}),
"options": 'Supplier',
"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: (args) => {
Expand Down

0 comments on commit b6a3e69

Please sign in to comment.