Skip to content

[T3264] FEAT: biennials are now sorted/grouped by country. - #1785

Merged
Danielgergely merged 1 commit into
14.0from
T3264-biennials-by-country
Aug 4, 2026
Merged

[T3264] FEAT: biennials are now sorted/grouped by country.#1785
Danielgergely merged 1 commit into
14.0from
T3264-biennials-by-country

Conversation

@Danielgergely

Copy link
Copy Markdown
Member
  • FEAT: calculate child's country and sort biennials according to country/partner
  • FEAT: add new group by country option
  • FEAT: child pictures are now also sorted according to country before zipped

- FEAT: calculate child's country and sort biennials according to country/partner
- FEAT: add new group by country option
- FEAT: child pictures are now also sorted according to country before zipped
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

Not safe to merge until pending communication jobs are refreshed when a child’s field office or country changes.

The reproduced stale-country behavior affects the core purpose of this change: country-based grouping and ordering can be wrong for transferred children. The directly exercised batch ordering and picture PDF/ZIP selection paths behaved correctly.

Files Needing Attention: partner_communication_switzerland/models/partner_communication.py needs an explicit invalidation or recomputation path for affected communication jobs when child field-office or country data changes.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced a proof for a posted P1 finding and attached the focused country ordering harness source and its output.
  • T-Rex attempted contract validation but it was blocked by the missing Odoo runtime and database, with the import check failing due to ModuleNotFoundError: No module named 'odoo'.
  • T-Rex produced an additional finding-proof for another posted P1 finding.
  • T-Rex documented the focused harness capture workflow, including uploading the harness source and command outputs, and noted that no Odoo runtime or database is installed, preventing ORM write/recompute and report rendering.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 Stored child country is not recomputed when a child changes field office or country

    • Bug
      • child_country_id is stored and drives both the new Country group-by filter and biennial ordering. Its compute declaration depends only on the job's object_ids and model. A child transfer after the communication job is created does not modify either job field, so Odoo has no dependency trigger to recompute the stored country. The executed harness showed the stored value stays Kenya after the child moves to Uganda; manually invoking the compute then yields Uganda. Consequently existing pending biennials may be grouped and printed under the former country.
    • Cause
      • The underlying objects are serialized in object_ids, a Char field (base contract communication_job.py:115, 322-345), rather than a relational field whose dotted child/field-office/country dependencies could be declared. The new compute at partner_communication.py:42-51 does not add another invalidation mechanism when compassion.child.field_office_id or its country_id changes.
    • Fix
      • Add an explicit invalidation/recompute path from child field-office/country changes for pending child communication jobs (for example, override the relevant child write/create transfer flow to find jobs whose comma-separated object_ids include that child and recompute/write child_country_id). Also backfill/recompute existing pending jobs. A simple dotted @api.depends path cannot traverse the serialized Char IDs.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "[T3264] FEAT: biennials are now sorted/g..." | Re-trigger Greptile

Comment thread partner_communication_switzerland/models/partner_communication.py
@Danielgergely
Danielgergely merged commit b6b42cf into 14.0 Aug 4, 2026
2 checks passed
@Danielgergely
Danielgergely deleted the T3264-biennials-by-country branch August 4, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant