Skip to content

RecurringTransaction

Auto-repeat definition for a recurring invoice or journal entry.

Attributes:
name: Unique identifier (auto-incremented).
source_doctype: DocType to clone on each recurrence (SalesInvoice / JournalEntry).
source_document_id: ID of the template document to clone.
frequency: Human-friendly label (Daily / Weekly / Monthly).
cron_expression: Cron expression used for scheduling.
next_run_date: Date when the next document should be created.
end_date: Optional date after which the job stops.
enabled: Toggle to pause without deleting the definition.
last_run_date: Date of last successful run (set by the job).

Source: doctype.py

Field Type Required Description Validators
source_doctype str DocType to clone (SalesInvoice or JournalEntry) -
source_document_id str ID of the template document -
frequency str Frequency label (Daily / Weekly / Monthly) -
cron_expression str Cron expression (e.g. ‘0 0 1 * *’ for monthly on the 1st) -
next_run_date date Date of next expected run -
end_date None Stop creating documents after this date (optional) -
enabled bool Whether this recurrence is active -
last_run_date None Date the recurrence last ran successfully -
Role Create Delete Read Write
Accountant
Admin
FinanceManager
Setting Value
Submittable False
Track Changes True

Controller hooks are implemented in *_controller.py files. Available lifecycle hooks:

  • validate() - Called before save, raise exceptions for validation errors
  • before_insert() - Called before inserting a new document
  • after_insert() - Called after successfully inserting
  • before_save() - Called before saving (insert or update)
  • after_save() - Called after saving
  • before_delete() - Called before deleting
  • after_delete() - Called after deleting