Is there currently any way of knowing if a document was created by auto-repeat? (i.e. an undocumented field on the document created by auto-repeat?)
If not, how hard would it be to modify auto-repeat to do this?
(i.e. if exists field: created_by_autorepeat, then created_by_autorepeat = true)
Since the source documents, or “templates” that auto-repeat uses live in the same doctype table with the target doctypes, that means if I prefix my auto-repeating doctypes with TMPL, i.e. “**TMPL_**Reminder To Take out trash weekly” then whatever auto-repeat creates will have TMPL_ in the name as well.
I suppose we could also accomplish this by checking if “TMPL_” exists in the source/template title/name {{ doc.name}} and if it does, strip the “TMPL_*” when creating the auto-repeated document.
#for any action that needs to take place after the recurring document creation
#on recurring method of that doctype is triggered
new_doc.run_method('on_recurring', reference_doc = reference_doc, auto_repeat_doc = auto_repeat_doc)
Hmm so maybe I just need to call on_recurring() to do all my post-auto-repeat document creation steps like:
Remove TMPL_* from the title/name of the cloned document
Set field created_by_autorepeat = true
Adjust any other fields I want i.e. if I want to set a due_date field to 30days from now()
Is this correct?
But where do I call on_recurring? In the server_side scripts for the doctype itself?