Skip to main content

RecentDocument

RecentDocument DocType.

Tracks recently viewed documents per user for quick navigation.

Attributes:
user_id: User who viewed the document
doctype: DocType of the viewed document
document_id: ID of the viewed document
document_name: Display name of the document
route: URL route to the document
viewed_at: When the document was last viewed

Source: recent_document.py

Fields​

FieldTypeRequiredDescriptionValidators
user_idstr✓User who viewed the document-
doctypestr✓DocType of the viewed document-
document_idstr✓ID of the viewed document-
document_namestr✓Display name of the document-
routeNoneURL route to the document-
viewed_atdatetimeWhen the document was last viewed-

Permissions​

RoleCreateDeleteReadWrite
All✓✓✓✓

Configuration​

SettingValue
SubmittableFalse
Track ChangesTrue

Controller​

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