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
Fields
Section titled “Fields”| 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 | - |
Permissions
Section titled “Permissions”| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| Accountant | ✓ | |||
| Admin | ✓ | ✓ | ✓ | ✓ |
| FinanceManager | ✓ | ✓ | ✓ |
Configuration
Section titled “Configuration”| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Section titled “Controller”Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting