[optimization] added timeline_doctype, timeline_name index in communication

This commit is contained in:
Anand Doshi 2016-02-13 16:42:04 +05:30
parent 33bc62aadb
commit a694de1876
2 changed files with 2 additions and 1 deletions

View file

@ -900,7 +900,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-02-02 06:39:17.516884",
"modified": "2016-02-13 06:39:17.516884",
"modified_by": "Administrator",
"module": "Core",
"name": "Communication",

View file

@ -164,6 +164,7 @@ class Communication(Document):
def on_doctype_update():
"""Add index in `tabCommunication` for `(reference_doctype, reference_name)`"""
frappe.db.add_index("Communication", ["reference_doctype", "reference_name"])
frappe.db.add_index("Communication", ["timeline_doctype", "timeline_name"])
def has_permission(doc, ptype, user):
if ptype=="read" and doc.reference_doctype and doc.reference_name: