Entitlement Summary View
Entitlement metrics come from two places:
The
beneficiary_list_summaryportion of the API response, specifically fields liketotal_disbursement_quantity,average_entitlement_per_registrant, and any mapping ofbenefit_code_idto value. These are processed withsummary_type='entitlement'The
registry_summarydictionary entries may also be tagged withsummary_type='entitlement', especially when they contain entitlement statistics (e.g.,entitlement_amount_q1,entitlement_amount_male_q3).
The same formatting logic applies as for eligibility lines: numeric formatting, measurement units looked up using benefit_code mapping, title-cased “key”.
Storage & UI linkage
Records with
summary_type='entitlement'are inserted into theg2p.api.summary.linemodel.In the UI, the summary view (for example the wizard’s results page) aggregates or lists these entitlement lines—allowing users to inspect disbursement quantities, averages and quartiles for each benefit code.
Customizing new fields
For entitlement fields (e.g., a new benefit code metric or multiplier-based value) you can follow a similar path:
Include the new entitlement metric in the
beneficiary_list_summaryor in theregistry_summaryas a dictionary keyed bybenefit_code_id.Extend your model to capture that metric (you may add fields to
BeneficiaryListSummaryFarmeror a custom summary model). Keep in mind that the logic for calculation and handling of this metric must also be created in the extensions.The generic loop in
_compute_summary_lineshandles dictionary-values: benefit_code_id → value. So no change is needed to logic. You only need to ensure your benefit code shows up ing2p.benefit.codessobenefit_mnemonicresolution works.If you need to display a new measurement unit, update the
measurement_uniting2p.benefit.codesrather than altering the loop logic.Again, bundle your additions in a separate Odoo module (inherit models, extend views) so core code remains untouched and upgradeable.
Last updated
Was this helpful?

