fix(comment): add communication to comment
This commit is contained in:
parent
d11dd760f8
commit
7b691cdd64
3 changed files with 7 additions and 2 deletions
|
|
@ -1 +1 @@
|
|||
disable=access-member-before-definition
|
||||
disable=access-member-before-definition, no-member
|
||||
|
|
@ -11,6 +11,7 @@ from frappe.core.doctype.communication.email import (validate_email,
|
|||
from frappe.core.utils import get_parent_doc, set_timeline_doc
|
||||
from frappe.utils.bot import BotReply
|
||||
from frappe.utils import parse_addr
|
||||
from frappe.core.doctype.comment.comment import update_comment_in_doc
|
||||
|
||||
from collections import Counter
|
||||
|
||||
|
|
@ -105,7 +106,10 @@ class Communication(Document):
|
|||
user=self.reference_name, after_commit=True)
|
||||
|
||||
def on_update(self):
|
||||
"""Update parent status as `Open` or `Replied`."""
|
||||
# add to _comment property of the doctype, so it shows up in
|
||||
# comments count for the list view
|
||||
update_comment_in_doc(self)
|
||||
|
||||
if self.comment_type != 'Updated':
|
||||
update_parent_mins_to_first_response(self)
|
||||
self.bot_reply()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ def execute():
|
|||
new_comment.comment_email = comment.sender
|
||||
new_comment.comment_by = comment.sender_full_name
|
||||
new_comment.subject = comment.subject
|
||||
new_comment.content = comment.content or comment.subject
|
||||
new_comment.reference_doctype = comment.reference_doctype
|
||||
new_comment.reference_name = comment.reference_name
|
||||
new_comment.link_doctype = comment.link_doctype
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue