G2P Registry: Audit Post
Contents
G2P Registry: Audit Post#
The OpenSPP Audit Post module extends the core audit logging capabilities by enabling the automatic posting of audit log messages to related parent records. This provides a centralized and comprehensive view of changes across interconnected data within social protection programs and farmer registries.
Purpose#
The OpenSPP Audit Post module is designed to streamline the tracking of data changes across complex, hierarchical data structures by:
Centralizing Audit Trails: Consolidate audit log messages from child records directly onto the communication timeline (chatter) of their designated parent records. For example, changes to a beneficiary's program enrollment (child record) can appear directly on the beneficiary's main profile (parent record).
Enhancing Contextual Awareness: Provide a complete historical context for key entities by displaying all relevant changes, regardless of which linked record they originated from, on a single parent record's view.
Improving Accountability and Transparency: Offer a clearer, more accessible audit trail for critical data, simplifying reviews and ensuring all relevant modifications are visible in one place.
Simplifying Data Oversight: Reduce the need to navigate through multiple linked records to understand the full history of an entity, making oversight more efficient for program managers and auditors.
Dependencies and Integration#
This module builds upon existing OpenSPP functionality and integrates with key platform components:
Base (base): Relies on Odoo's fundamental data models, views, and core system functionalities.
Mail (mail): Leverages the communication and messaging features to post audit log entries as messages on the chatter of parent records, making them visible in the record's activity stream.
SPP Audit Log (spp_audit_log): This module is a direct extension of the OpenSPP Audit Log module. It enhances the
spp.audit.logandspp.audit.rulemodels to enable the identification of parent records and the automatic posting of generated audit messages to those parents.
Additional Functionality#
The module introduces several key features to facilitate consolidated audit logging:
Defining Parent-Child Audit Relationships#
Administrators can configure audit rules to establish explicit parent-child relationships between different data models. This involves selecting a "Parent Rule" and specifying a "Field that connects this model to the model of the parent rule" within the spp.audit.rule configuration. For instance, you can define that a Program Enrollment record is a child of a Beneficiary record via a specific many-to-one field. This ensures that changes to child records are correctly linked back to their main parent.
Automatic Posting to Parent Record Timelines#
When a change is detected and logged for a child record according to a defined audit rule, this module automatically posts a summary of that change to the communication timeline (chatter) of the identified parent record. This means that instead of having to look up the child record's audit log, the relevant audit information appears directly on the parent's activity feed, providing immediate context.
Consolidated Audit View on Parent Records#
The audit log messages posted to parent record timelines include a clear, HTML-formatted table summarizing the specific data changes. This table details the model, field, old value, and new value, making it easy to quickly understand what modifications were made on the related child record without needing to access the full audit log. This aggregated view streamlines the review process for managers.
Dynamic Parent Record Identification#
The module intelligently identifies the "most parent" record in a hierarchical structure. For example, if a Program Enrollment (child) is linked to a Household Member (intermediate parent), which is then linked to a Household (most parent), the audit log can be configured to post to the Household record, ensuring the highest-level entity receives the consolidated audit information.
Conclusion#
The OpenSPP Audit Post module significantly enhances the audit capabilities of OpenSPP by centralizing data change visibility, providing a comprehensive and easily accessible history for core program entities.
openspp.org