fix: Patch fix, Travis fix and cleanup
- Added UOM column in Report
- Removed mandatory on `valid_till`
- Added list view indicator for Expired status in Supplier Quotation
- Sorted Labels in Chart and syntax cleanup
- Made labels Translatable
- Fixed patch
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index 6964e78..3bc441a 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -796,15 +796,14 @@
{
"fieldname": "valid_till",
"fieldtype": "Date",
- "label": "Valid Till",
- "reqd": 1
+ "label": "Valid Till"
}
],
"icon": "fa fa-shopping-cart",
"idx": 29,
"is_submittable": 1,
"links": [],
- "modified": "2020-04-14 22:43:32.248415",
+ "modified": "2020-04-15 11:44:52.958022",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js
index 9555439..9f4fece 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js
@@ -5,6 +5,8 @@
return [__("Ordered"), "green", "status,=,Ordered"];
} else if(doc.status==="Rejected") {
return [__("Lost"), "darkgrey", "status,=,Lost"];
+ } else if(doc.status==="Expired") {
+ return [__("Expired"), "darkgrey", "status,=,Expired"];
}
}
};
diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js
index f331beb..fe4abd8 100644
--- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js
+++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js
@@ -60,28 +60,29 @@
prepare_chart_data: (result) => {
let supplier_wise_map = {}, data_points_map = {};
- let qty_list = result.map(res=> res.qty);
+ let qty_list = result.map(res => res.qty);
+ qty_list.sort();
qty_list = new Set(qty_list);
// create supplier wise map like in Report
- for(let res of result){
- if(!(res.supplier in supplier_wise_map)){
- supplier_wise_map[res.supplier]= {};
+ for (let res of result) {
+ if (!(res.supplier in supplier_wise_map)) {
+ supplier_wise_map[res.supplier] = {};
}
supplier_wise_map[res.supplier][res.qty] = res.price;
}
// create datapoints for each qty
- for(let supplier of Object.keys(supplier_wise_map)) {
+ for (let supplier of Object.keys(supplier_wise_map)) {
let row = supplier_wise_map[supplier];
- for(let qty of qty_list){
- if(!data_points_map[qty]){
- data_points_map[qty] = []
+ for (let qty of qty_list) {
+ if (!data_points_map[qty]) {
+ data_points_map[qty] = [];
}
- if(row[qty]){
+ if (row[qty]) {
data_points_map[qty].push(row[qty]);
}
- else{
+ else {
data_points_map[qty].push(null);
}
}
@@ -90,11 +91,10 @@
let dataset = [];
qty_list.forEach((qty) => {
let datapoints = {
- 'name': 'Price for Qty ' + qty,
+ 'name': __('Price for Qty ') + qty,
'values': data_points_map[qty]
}
dataset.push(datapoints);
-
});
return dataset;
},
diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
index bb1067a..fd7a731 100644
--- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
+++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cint
+from frappe import _
from collections import defaultdict
from erpnext.setup.utils import get_exchange_rate
@@ -50,6 +51,7 @@
"quotation": data.get("parent"),
"qty": data.get("qty"),
"price": flt(data.get("rate") * exchange_rate, float_precision),
+ "uom": data.get("uom"),
"request_for_quotation": data.get("request_for_quotation"),
"supplier": data.get("supplier") # used for chart generation
}
@@ -78,34 +80,41 @@
def get_columns():
columns = [{
"fieldname": "supplier_name",
- "label": "Supplier",
+ "label": _("Supplier"),
"fieldtype": "Link",
"options": "Supplier",
"width": 200
},
{
"fieldname": "quotation",
- "label": "Supplier Quotation",
+ "label": _("Supplier Quotation"),
"fieldtype": "Link",
"options": "Supplier Quotation",
"width": 200
},
{
"fieldname": "qty",
- "label": "Quantity",
+ "label": _("Quantity"),
"fieldtype": "Float",
"width": 80
},
{
"fieldname": "price",
- "label": "Price",
+ "label": _("Price"),
"fieldtype": "Currency",
"options": "Company:company:default_currency",
"width": 110
},
{
+ "fieldname": "uom",
+ "label": _("UOM"),
+ "fieldtype": "Link",
+ "options": "UOM",
+ "width": 90
+ },
+ {
"fieldname": "request_for_quotation",
- "label": "Request for Quotation",
+ "label": _("Request for Quotation"),
"fieldtype": "Link",
"options": "Request for Quotation",
"width": 200
diff --git a/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py b/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py
index 0f24ec6..befa46c 100644
--- a/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py
+++ b/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py
@@ -2,7 +2,7 @@
import frappe
def execute():
- reload_doc("buying", "doctype", "suppplier_quotation")
+ frappe.reload_doc("buying", "doctype", "suppplier_quotation")
frappe.db.sql("""UPDATE `tabSupplier Quotation`
SET valid_till = DATE_ADD(transaction_date , INTERVAL 1 MONTH)
WHERE docstatus < 2""")
\ No newline at end of file