sheno
#1
i want to delet all the timesheet and start from begining
- the timesheet to be deleted it must be first cancel then i can delet it
But i have many time time sheet so i have to manulay open every time sheet and cancel then be able to delet
is there another way to multi cancel multi delet ?
thank alot for your help .
rohit_w
#2
Hi @sheno,
If the timesheet is not linked with any doctype then it can be feasible
Run below script from the bench console
for data in frappe.get_list('Timesheet', fields = ["name"], filters = ["docstatus", "<", "2"]):
doc = frappe.get_doc('Timesheet', data.name)
if doc.docstatus == 1:
doc.cancel()
frappe.delete_doc('Timesheet', data.name)
3 Likes
sheno
#3
Thx a lot dear for your help