[fix] show timeline_emails on timeline_docname (#2238)

This commit is contained in:
robert schouten 2016-11-14 14:39:46 +08:00 committed by Rushabh Mehta
parent ca22d756e3
commit 5cfe9c70c1

View file

@ -153,12 +153,16 @@ def get_communication_data(doctype, name, start=0, limit=20, after=None, fields=
conditions = '''communication_type in ("Communication", "Comment")
and (
(reference_doctype=%(doctype)s and reference_name=%(name)s)
or (timeline_doctype=%(doctype)s
and timeline_name=%(name)s
and communication_type="Comment"
and comment_type in ("Created", "Updated", "Submitted", "Cancelled", "Deleted"))
)
and (comment_type is null or comment_type != 'Update')'''
or (
(timeline_doctype=%(doctype)s and timeline_name=%(name)s)
and (
communication_type="Communication"
or (
communication_type="Comment"
and comment_type in ("Created", "Updated", "Submitted", "Cancelled", "Deleted")
)))
)'''
if after:
# find after a particular date