fix: allow pending within review date (#19577)

* fix: allow pending within review date

referenced - fix: allow Pending on review date #19497
explanation for closing not valid

* fix: codacy
This commit is contained in:
RJPvT
2019-11-14 05:40:02 +01:00
committed by Nabin Hait
parent 3b38a9e418
commit fb2d4884b3

View File

@@ -7,7 +7,7 @@ import json
import frappe
from frappe import _, throw
from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate
from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate, today
from frappe.utils.nestedset import NestedSet
@@ -201,6 +201,9 @@ def set_multiple_status(names, status):
def set_tasks_as_overdue():
tasks = frappe.get_all("Task", filters={'status':['not in',['Cancelled', 'Closed']]})
for task in tasks:
if frappe.db.get_value("Task", task.name, "status") in 'Pending Review':
if getdate(frappe.db.get_value("Task", task.name, "review_date")) < getdate(today()):
continue
frappe.get_doc("Task", task.name).update_status()
@frappe.whitelist()