fix: Standard filter and dashboard fixes in quotation and opportunity

This commit is contained in:
deepeshgarg007
2019-05-11 20:09:29 +05:30
parent b2ff0bda32
commit 569815b5ad
6 changed files with 28 additions and 9 deletions

View File

@@ -5,8 +5,8 @@ def get_data():
return { return {
'fieldname': 'lead', 'fieldname': 'lead',
'non_standard_fieldnames': { 'non_standard_fieldnames': {
'Quotation': 'party_name', 'Quotation': 'customer_name',
'Opportunity': 'party_name' 'Opportunity': 'customer_name'
}, },
'transactions': [ 'transactions': [
{ {

View File

@@ -136,7 +136,7 @@
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 1, "in_standard_filter": 1,
"label": "Customer/Lead", "label": "Party",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"oldfieldname": "customer", "oldfieldname": "customer",
@@ -1468,7 +1468,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"modified": "2019-04-25 18:55:43.874656", "modified": "2019-05-11 19:22:33.533487",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "CRM", "module": "CRM",
"name": "Opportunity", "name": "Opportunity",

View File

@@ -17,5 +17,13 @@ frappe.listview_settings['Opportunity'] = {
listview.page.add_menu_item(__("Set as Closed"), function() { listview.page.add_menu_item(__("Set as Closed"), function() {
listview.call_for_selected_items(method, {"status": "Closed"}); listview.call_for_selected_items(method, {"status": "Closed"});
}); });
listview.page.fields_dict.opportunity_from.get_query = function() {
return {
"filters": {
"name": ["in", ["Customer", "Lead"]],
}
};
};
} }
}; };

View File

@@ -7,8 +7,8 @@ def get_data():
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'), 'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
'fieldname': 'customer', 'fieldname': 'customer',
'non_standard_fieldnames': { 'non_standard_fieldnames': {
'Quotation': 'party_name', 'Quotation': 'customer_name',
'Opportunity': 'party_name' 'Opportunity': 'customer_name'
}, },
'transactions': [ 'transactions': [
{ {

View File

@@ -133,7 +133,7 @@
"in_filter": 0, "in_filter": 0,
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0, "in_standard_filter": 1,
"label": "Quotation To", "label": "Quotation To",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@@ -169,7 +169,7 @@
"in_filter": 0, "in_filter": 0,
"in_global_search": 1, "in_global_search": 1,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0, "in_standard_filter": 1,
"label": "Party", "label": "Party",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@@ -3224,7 +3224,7 @@
"istable": 0, "istable": 0,
"max_attachments": 1, "max_attachments": 1,
"menu_index": 0, "menu_index": 0,
"modified": "2019-05-07 14:29:22.565474", "modified": "2019-05-11 19:26:50.735628",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Quotation", "name": "Quotation",

View File

@@ -1,6 +1,17 @@
frappe.listview_settings['Quotation'] = { frappe.listview_settings['Quotation'] = {
add_fields: ["customer_name", "base_grand_total", "status", add_fields: ["customer_name", "base_grand_total", "status",
"company", "currency", 'valid_till'], "company", "currency", 'valid_till'],
onload: function(listview) {
listview.page.fields_dict.quotation_to.get_query = function() {
return {
"filters": {
"name": ["in", ["Customer", "Lead"]],
}
};
};
},
get_indicator: function(doc) { get_indicator: function(doc) {
if(doc.status==="Submitted") { if(doc.status==="Submitted") {
if (doc.valid_till && doc.valid_till < frappe.datetime.nowdate()) { if (doc.valid_till && doc.valid_till < frappe.datetime.nowdate()) {