mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
[minor] fix update_mins_to_first_response patch
This commit is contained in:
@@ -7,12 +7,14 @@ def execute():
|
|||||||
frappe.reload_doctype('Opportunity')
|
frappe.reload_doctype('Opportunity')
|
||||||
|
|
||||||
for doctype in ('Issue', 'Opportunity'):
|
for doctype in ('Issue', 'Opportunity'):
|
||||||
for parent in frappe.get_all(doctype, order_by='creation desc', limit=1000):
|
frappe.db.sql('update tab{0} set mins_to_first_response=0'.format(doctype))
|
||||||
|
for parent in frappe.get_all(doctype, order_by='creation desc', limit=500):
|
||||||
|
parent_doc = frappe.get_doc(doctype, parent.name)
|
||||||
for communication in frappe.get_all('Communication',
|
for communication in frappe.get_all('Communication',
|
||||||
filters={'reference_doctype': doctype, 'reference_name': parent.name},
|
filters={'reference_doctype': doctype, 'reference_name': parent.name,
|
||||||
order_by = 'creation desc', limit=2):
|
'communication_medium': 'Email'},
|
||||||
|
order_by = 'creation asc', limit=2):
|
||||||
|
|
||||||
parent_doc = frappe.get_doc(doctype, parent.name)
|
|
||||||
communication_doc = frappe.get_doc('Communication', communication.name)
|
communication_doc = frappe.get_doc('Communication', communication.name)
|
||||||
|
|
||||||
update_mins_to_first_communication(parent_doc, communication_doc)
|
update_mins_to_first_communication(parent_doc, communication_doc)
|
||||||
|
|||||||
Reference in New Issue
Block a user