Eligibility Summary View
Eligibility metrics are primarily derived from the registry_summary section of the API response. This section contains registry-type specific statistics (e.g., for a farmer registry: land holding mean, quartiles; or for a student registry: enrollment counts).
The method _compute_summary_lines checks dictionary entries in registry_summary and when found, attributes summary_type='eligibility'. The “key” field is generated by taking the dictionary key, replacing underscores with spaces and title-casing, and appending the benefit code mnemonic when applicable. The “value” gets been formatted as either '{:,}'.format(int(value)) for numbers, or str(value) for strings, and measurement units are appended if available.
Storage & UI linkage
Each eligibility line becomes a record in
g2p.api.summary.linewithsummary_type='eligibility'.The wizard form renders these lines grouped by summary type so the user sees “Eligibility” section lines separately (if UI grouping is implemented).
Customizing New Fields
To add new eligibility-fields (for example a new quartile or demographic statistic) without modifying the core summary logic:
Extend the API schema to include your new field under
registry_summary. Keep in mind that the logic for calculation and handling of this new field must also be created in the extensions.Add a corresponding field in your Odoo summary-model (e.g., inherit
g2p.api.summary.lineor the registry-specific summary model) via a custom module.Because
_compute_summary_linesdynamically creates summary lines for all keys inregistry_summary, the new field will automatically surface in the UI — you only need to add proper formatting/units if needed.If you want the new field to be tagged as “eligibility” (rather than “general” or “entitlement”), ensure it appears under the non-dictionary (scalar) section when processing
registry_summary.In your custom module’s manifest add only the model extension and any view tweaks; you don’t modify
_compute_summary_lines. This preserves upgrade-safety of the core PBMS module.
Last updated
Was this helpful?

