fix: use communication date in timeline

Before, we used the database creation date, which coincidentally corresponds to the real communication date in many cases.
This commit is contained in:
barredterra 2024-02-13 15:36:53 +01:00
parent 70867b47a4
commit 10bd9a7efd
3 changed files with 6 additions and 6 deletions

View file

@ -287,7 +287,7 @@ def get_communication_data(
if after:
# find after a particular date
conditions += f"""
AND C.creation > {after}
AND C.communication_date > {after}
"""
if doctype == "User":
@ -319,7 +319,7 @@ def get_communication_data(
SELECT *
FROM (({part1}) UNION ({part2})) AS combined
{group_by}
ORDER BY creation DESC
ORDER BY communication_date DESC
LIMIT %(limit)s
OFFSET %(start)s
""".format(part1=part1, part2=part2, group_by=(group_by or "")),

View file

@ -234,7 +234,7 @@ class FormTimeline extends BaseTimeline {
communication_timeline_contents.push({
icon: icon_set[medium],
icon_size: "sm",
creation: communication.creation,
creation: communication.communication_date,
is_card: true,
content: this.get_communication_timeline_content(communication),
doctype: "Communication",

View file

@ -23,7 +23,7 @@
{% } %}
<div class="text-muted">
{{ comment_when(doc.creation) }}
{{ comment_when(doc.communication_date) }}
</div>
</span>
{% } else if (doc.comment_type && doc.comment_type == "Comment") { %}
@ -33,7 +33,7 @@
<span class="text-muted">{{ __("commented") }}</span>
<span> . </span>
<span class="margin-left text-muted">
{{ comment_when(doc.creation) }}
{{ comment_when(doc.communication_date) }}
</span>
</span>
{% } else { %}
@ -44,7 +44,7 @@
{{ doc.user_full_name || frappe.user.full_name(doc.owner) }}
<span> . </span>
<span class="text-muted">
{{ comment_when(doc.creation) }}
{{ comment_when(doc.communication_date) }}
</span>
{% if (doc.subject) { %}
<div class="text-muted my-1">{{doc.subject}}</div>