[Solved] What's the best way to allow changing reference doc in Auto Repeat

Sometimes we may want to change the invoice content in an autorepeat.

The system filters “is not an auto repeat” in the selection field. This means we cant use a later invoice to “update” the invoice content in an auto repeat. Even if we create a new auto-repeat docType, the refence Sales invoice would’ve been created by auto-repeat and not allowed.

How best to override ERPnext’s implementation on the filter for reference_doc in Auto Repeat? Current filter in auto_repeat.js “Auto Repeate = Empty” as seen in lines 13-19 here.

Currently, I have to use a database client to manually modify the field. This should not be necessary and is a poor user experience.

Untested, but something like this should work:

frm.set_query("reference_document", { filters:[] })

Usual caveats to use with caution. This may create data structures different from what ERPNext expects.

I’m just realizing this is not an issue. While the filter for reference_document is too restrictive, there are no validations to prevent me from typing/pasting another document (even if it was created via auto repeat).