[patch] mins_to_first_response in opporutnity and issue
diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json
index 0f45c60..2a0820b 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.json
+++ b/erpnext/crm/doctype/opportunity/opportunity.json
@@ -3,6 +3,7 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
+ "beta": 0,
"creation": "2013-03-07 18:50:30",
"custom": 0,
"description": "Potential Sales Deal",
@@ -303,6 +304,31 @@
},
{
"allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "mins_to_first_response",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mins to first response",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "with_items",
@@ -968,13 +994,14 @@
"hide_toolbar": 0,
"icon": "icon-info-sign",
"idx": 195,
+ "image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-04-06 03:15:24.676978",
+ "modified": "2016-06-14 15:50:55.080217",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity",
@@ -1021,6 +1048,7 @@
"write": 1
}
],
+ "quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 363a5a6..e3aa04b 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -269,4 +269,5 @@
execute:frappe.delete_doc_if_exists("Page", "financial-analytics")
erpnext.patches.v7_0.update_project_in_gl_entry
execute:frappe.db.sql('update tabQuotation set status="Cancelled" where docstatus=2')
-execute:frappe.rename_doc("DocType", "Payments", "Sales Invoice Payment", force=True)
\ No newline at end of file
+execute:frappe.rename_doc("DocType", "Payments", "Sales Invoice Payment", force=True)
+erpnext.patches.v7_0.update_mins_to_first_response
diff --git a/erpnext/patches/v7_0/update_mins_to_first_response.py b/erpnext/patches/v7_0/update_mins_to_first_response.py
new file mode 100644
index 0000000..566627e
--- /dev/null
+++ b/erpnext/patches/v7_0/update_mins_to_first_response.py
@@ -0,0 +1,21 @@
+import frappe
+
+from frappe.core.doctype.communication.email import update_mins_to_first_communication
+
+def execute():
+ frappe.reload_doctype('Issue')
+ frappe.reload_doctype('Opportunity')
+
+ for doctype in ('Issue', 'Opportunity'):
+ for parent in frappe.get_all(doctype, order_by='creation desc', limit=1000):
+ for communication in frappe.get_all('Communication',
+ filters={'reference_doctype': doctype, 'reference_name': parent.name},
+ order_by = 'creation desc', limit=2):
+
+ parent_doc = frappe.get_doc(doctype, parent.name)
+ communication_doc = frappe.get_doc('Communication', communication.name)
+
+ update_mins_to_first_communication(parent_doc, communication_doc)
+
+ if parent_doc.mins_to_first_response:
+ continue
\ No newline at end of file
diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css
index 719f259..9a015c2 100644
--- a/erpnext/public/css/erpnext.css
+++ b/erpnext/public/css/erpnext.css
@@ -141,6 +141,7 @@
.pos-payment-row {
border-bottom: 1px solid #d1d8dd;
margin: 2px 0px 5px 0px;
+ height: 60px;
}
.pos-payment-row:hover,
.pos-keyboard-key:hover {
@@ -158,9 +159,6 @@
background-color: #FDFDFD;
border-color: #e8e8e8;
}
-.amount {
- margin-top: 5px;
-}
.amount-label {
font-size: 16px;
}
diff --git a/erpnext/support/doctype/issue/issue.json b/erpnext/support/doctype/issue/issue.json
index be9603b..6da9b1c 100644
--- a/erpnext/support/doctype/issue/issue.json
+++ b/erpnext/support/doctype/issue/issue.json
@@ -62,7 +62,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "subject",
"fieldtype": "Data",
@@ -88,6 +88,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "mins_to_first_response",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mins to First Response",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "cb00",
"fieldtype": "Column Break",
"hidden": 0,
@@ -137,7 +162,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "eval:doc.__islocal",
"fieldname": "raised_by",
@@ -217,7 +242,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "description",
@@ -677,13 +702,14 @@
"hide_toolbar": 0,
"icon": "icon-ticket",
"idx": 7,
+ "image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-06-04 16:01:15.860333",
+ "modified": "2016-06-14 15:38:50.458873",
"modified_by": "Administrator",
"module": "Support",
"name": "Issue",