ToDo Auto status changed to close

Hi our material request is link in ToDo is there a way when the material requested status change to “ordered” and “stop” the ToDo document will change the status to Close.

Thanks in advance

@xchicox Try some server script where you will just push status to Stop of linked todo once Mr Status changed

can you share me a script please.

Thanks

@xchicox

def on_update(doc, method):
    if doc.linked_todo_fieldname:
        frappe.db.set_value('ToDo', doc.linked_todo_fieldname, 'status' status_value)

You might need to changes something here as per your conditions of status and it’s value,

i dont know if im doing it correctly,