Skip to content

Commit

Permalink
fix: show attachments on ticket creation
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Dec 17, 2024
1 parent 8ec1af9 commit a620437
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions helpdesk/helpdesk/doctype/hd_ticket/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
def new(doc, attachments=[]):
doc["doctype"] = "HD Ticket"
doc["via_customer_portal"] = bool(frappe.session.user)
doc['attachments'] = attachments
d = frappe.get_doc(doc).insert()
return d

Expand Down
2 changes: 2 additions & 0 deletions helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ def reply_via_agent(
@frappe.whitelist()
# flake8: noqa
def create_communication_via_contact(self, message, attachments=[]):

if self.status == "Replied":
self.status = "Open"
log_ticket_activity(self.name, "set status to Open")
Expand All @@ -637,6 +638,7 @@ def create_communication_via_contact(self, message, attachments=[]):
c.ignore_mandatory = True
c.save(ignore_permissions=True)

attachments = self.get("attachments", [])
if not len(attachments):
return
QBFile = frappe.qb.DocType("File")
Expand Down

0 comments on commit a620437

Please sign in to comment.