forked from frappe/helpdesk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ux): ticket: move
feedback
to master doctype (frappe#1585)
- Loading branch information
Showing
7 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
helpdesk/helpdesk/doctype/hd_ticket/patches/feedback_in_master.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import frappe | ||
|
||
|
||
def execute(): | ||
""" | ||
Move feedback rating and text from `HD Ticket Feedback Option` to `HD Ticket`. | ||
This is sometimes better because it avoids an extra API call when fetching. | ||
""" | ||
for t in frappe.get_all("HD Ticket"): | ||
t = frappe.get_doc("HD Ticket", t.name) | ||
if not t.feedback: | ||
continue | ||
if not frappe.db.exists("HD Ticket Feedback Option", t.feedback): | ||
continue | ||
f = frappe.get_doc("HD Ticket Feedback Option", t.feedback) | ||
t.db_set("feedback_rating", f.rating) | ||
t.db_set("feedback_text", f.label) | ||
frappe.db.commit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters