-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3014 from ONE-F-M/test-production
Test production to Master
- Loading branch information
Showing
12 changed files
with
333 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import frappe | ||
from frappe.utils import getdate | ||
from frappe.desk.form.assign_to import add as add_assignment | ||
|
||
|
||
def validate_hd_ticket(doc,event): | ||
if not doc.is_new(): | ||
existing_todo = frappe.get_all("ToDo",{'reference_name':doc.name,'reference_type':'HD Ticket'},['name']) | ||
if not existing_todo: | ||
bug_buster = frappe.get_all("Bug Buster",{'docstatus':1,'from_date':['<=',getdate()],'to_date':['>=',getdate()]},['employee']) | ||
if bug_buster: | ||
emp_user = frappe.get_value("Employee",bug_buster[0].employee,'user_id') | ||
if emp_user: | ||
add_assignment({ | ||
'doctype': "HD Ticket", | ||
'name': str(doc.name), | ||
'assign_to': [emp_user], | ||
"description": "Please Review Issue", | ||
}) | ||
|
||
def assign_to_bug_buster(doc, event): | ||
""" | ||
Assign Ticket to the bug buster if any exists | ||
""" | ||
bug_buster = frappe.get_all("Bug Buster",{'docstatus':1,'from_date':['<=',getdate()],'to_date':['>=',getdate()]},['employee']) | ||
if bug_buster: | ||
emp_user = frappe.get_value("Employee",bug_buster[0].employee,'user_id') | ||
if emp_user: | ||
existing_todo = frappe.get_all("ToDo",{'reference_name':doc.name,'reference_type':'HD Ticket'},['name']) | ||
if not existing_todo: | ||
add_assignment({ | ||
'doctype': "HD Ticket", | ||
'name': str(doc.name), | ||
'assign_to': [emp_user], | ||
"description": "Please Review Issue details", | ||
}) |
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
Oops, something went wrong.