Hello,
i want to create a Serverscript that checks if an “Expiration date” is due in a specific doctype and automatically creates an task. I created a server script schedule and i see it gets executed without error but no task gets created. I tried debugging the script but i cannot get outputs from the web console.
def create_tasks_before_expiration():
today_date = today()
documents = frappe.get_all("Licence", filters={"expiration_date": today_date})
for document in documents:
task = frappe.new_doc("Task")
task.subject = "License is about to expire"
task.description = "License is about to expire"
task.status = "Open"
task.insert()
frappe.db.commit()