Skip to content

StockOutboxEntry

Outbox entry for a pending stock-keeper transfer call.

Attributes:
outbox_id: Stable UUID — safe for dedup on retries.
operation: The external operation to perform (e.g. ``transfer_stock``).
payload_json: JSON-serialised arguments for the call.
status: Current lifecycle state.
retry_count: Number of failed attempts so far.
error: Last error message (if any).
created_at: When this entry was created.
processed_at: When the relay successfully processed the entry.
reference_id: Source ``StockEntry.entry_no``.
transfer_id: Identifier returned by stock-keeper on success.

Source: doctype.py

Field Type Required Description Validators
outbox_id str Unique outbox entry ID (UUID) -
operation str Operation to dispatch: transfer_stock reverse_stock_transfer
payload_json str JSON-serialised call arguments -
status str Lifecycle state: Pending Sent
retry_count int Number of failed relay attempts -
error None Last error message from stock-keeper or transport layer -
created_at datetime UTC timestamp when the entry was created -
processed_at None UTC timestamp when the relay processed the entry -
reference_id str Source StockEntry.entry_no -
transfer_id None Transfer identifier returned by stock-keeper on success -
Role Create Delete Read Write
All
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