Merge pull request #30882 from fproldan/issue_25414

fix: "Supplier Quotation Comparison" - Tools - Select Default Supplier
This commit is contained in:
Deepesh Garg 2022-05-04 14:23:17 +05:30 committed by GitHub
commit 8535ad46e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,11 +114,11 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
onload: (report) => { onload: (report) => {
// Create a button for setting the default supplier // Create a button for setting the default supplier
report.page.add_inner_button(__("Select Default Supplier"), () => { report.page.add_inner_button(__("Select Default Supplier"), () => {
let reporter = frappe.query_reports["Quoted Item Comparison"]; let reporter = frappe.query_reports["Supplier Quotation Comparison"];
//Always make a new one so that the latest values get updated //Always make a new one so that the latest values get updated
reporter.make_default_supplier_dialog(report); reporter.make_default_supplier_dialog(report);
}, 'Tools'); }, __("Tools"));
}, },
make_default_supplier_dialog: (report) => { make_default_supplier_dialog: (report) => {
@ -126,7 +126,7 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
if(!report.data) return; if(!report.data) return;
let filters = report.get_values(); let filters = report.get_values();
let item_code = filters.item; let item_code = filters.item_code;
// Get a list of the suppliers (with a blank as well) for the user to select // Get a list of the suppliers (with a blank as well) for the user to select
let suppliers = $.map(report.data, (row, idx)=>{ return row.supplier_name }) let suppliers = $.map(report.data, (row, idx)=>{ return row.supplier_name })
@ -152,7 +152,7 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
] ]
}); });
dialog.set_primary_action("Set Default Supplier", () => { dialog.set_primary_action(__("Set Default Supplier"), () => {
let values = dialog.get_values(); let values = dialog.get_values();
if(values) { if(values) {
// Set the default_supplier field of the appropriate Item to the selected supplier // Set the default_supplier field of the appropriate Item to the selected supplier