Skip to content

Latest commit

 

History

History

README.rst

OpenSPP Event Data

Production/Stable License: LGPL-3 OpenSPP/OpenSPP2

Records and tracks events for registrants from surveys, field visits, and external systems. Supports flexible data storage (JSON, custom fields, or dedicated models), configurable lifecycle rules (auto-supersede, expiry, approval workflows), and automatic change request generation when event data differs from registrant records.

Key Capabilities

  • Configure event types with categories (survey, visit, sync, manual), target types, and storage modes
  • Record events with collection metadata (date, collector, source reference) and expiry tracking
  • Store event data in JSON, define custom fields, or link to dedicated Odoo models
  • Automatically supersede previous active events when new ones arrive for the same registrant
  • Auto-expire events after a configurable number of days via scheduled cron
  • Require approval for new events before activation using configurable workflows
  • Integrate with external sources (ODK Central, KoBoToolbox, APIs) with field mapping and transformations
  • Generate change requests when event data differs from registrant fields (requires spp_change_request)
  • Track event history with state transitions: draft → pending → active → superseded/expired/cancelled

Key Models

Model Description
spp.event.data Event record with registrant link, collection metadata
spp.event.type Event type configuration (category, lifecycle, source)
spp.event.field Custom field definition for JSON-based event types
spp.event.type.mapping Field mapping for external source data transformation
spp.create.event.wizard Wizard to create new event records from registrant form

Configuration

After installing:

  1. Navigate to Settings > Technical > Actions and search for "Event Types" to access event type configuration
  2. Create event types specifying code, category, target type, and storage mode
  3. For external sources: configure server URL, project ID, form ID, and field mappings in the "External Source" tab
  4. For approval: assign an approval definition from spp_approval module in the "Lifecycle Rules" tab
  5. For change requests: enable in "Change Request" tab and configure mappings (requires spp_change_request)
  6. Verify Event Data: Expire Events scheduled action is active under Settings > Technical > Scheduled Actions

UI Location

  • Registrant Form: "Event Data" stat button in button box opens create wizard
  • Registrant Form: Events section displays event history list with state badges
  • Event Data: Access via window action action_spp_event_data (no menu defined in this module)
  • Event Form Tabs: Event Data, Source, History, Legacy Data, Approval

Security

Group Access
spp_security.group_spp_admin Full CRUD
spp_registry.group_registry_manager Full CRUD
spp_registry.group_registry_officer Read/Write/Create
spp_registry.group_registry_viewer Read
spp_registry.group_registry_read Read
spp_registry.group_registry_write Read/Write
spp_registry.group_registry_create Read/Write/Create

Extension Points

  • Inherit spp.event.type and override get_connector() to add custom external source connectors
  • Inherit spp.event.data and override _create_change_requests() to customize change request logic
  • Use _get_active_event_id(), get_active_event(), and get_event_data_value() methods on res.partner for O(1) event lookup
  • Call _refresh_active_event_cache() on registrants when events are activated/deactivated for cache consistency

Dependencies

base, mail, spp_registry, spp_base_common, spp_security, spp_approval

Table of contents

19.0.2.0.0

  • Initial migration to OpenSPP2

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • OpenSPP.org

Maintainers

Current maintainers:

jeremi gonzalesedwin1123 emjay0921

This module is part of the OpenSPP/OpenSPP2 project on GitHub.

You are welcome to contribute.