New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moved feed from Communication to Activity Log #4435
Conversation
cecdfda
to
34d1abc
Compare
34d1abc
to
de299b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 write a test case that creates an activity log and then checks the query
frappe.reload_doc("core", "doctype", "activity_log") | ||
|
||
communication_data = frappe.get_all('Communication', filters= {'comment_type': 'Updated'}) | ||
activity_log_field = frappe.get_meta('Activity Log').fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be plural
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, will change.
adf0249
to
8814b10
Compare
creation = frappe.db.get_value('Communication', {'name': d.name}, 'creation') | ||
modified = frappe.db.get_value('Communication', {'name': d.name}, 'modified') | ||
|
||
frappe.db.set_value('Activity Log', activity_doc.name, 'creation', creation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be just communication_doc.creation
, no need to query again
a9151ae
to
3a11a89
Compare
@rmehta Fixed! |
activity_doc = frappe.get_doc(activity_data) | ||
activity_doc.insert() | ||
|
||
frappe.db.set_value('Activity Log', activity_doc.name, 'creation', communication_doc.creation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why set_value?
Can't we set creation and modified datetime at the time of activity log creation?
frappe/model/delete_doc.py
Outdated
@@ -276,6 +283,11 @@ def delete_dynamic_links(doctype, name): | |||
set timeline_doctype=null, timeline_name=null | |||
where timeline_doctype=%s and timeline_name=%s""", (doctype, name)) | |||
|
|||
# unlink feed | |||
frappe.db.sql("""update `tabActivity Log` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does doctype, docname changes here?
If no then you can merge Unlink activity log and unlink feed together in single update query
9cb04b3
to
a813b27
Compare
#4233
Summary:
comment_type == Updated
from Communication DocType.activity_log
.activity_log
.comment_type == Updated
are moved to Activity Log and deleted from Communication, along with the creation date and time.