Skip to content

[MIG] forward-port changes from 14.0#2111

Merged
ecino merged 2 commits into
18.0from
18.0-ff
Jul 9, 2026
Merged

[MIG] forward-port changes from 14.0#2111
ecino merged 2 commits into
18.0from
18.0-ff

Conversation

@ecino

@ecino ecino commented Jul 9, 2026

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces deferred invoice cleanup for child departures until exit communications are sent, along with UI highlights for pending exit communications. It also updates user profile access rights, refactors year extraction in interventions using regex, and adjusts various configurations. Feedback focuses on addressing potential runtime errors—such as handling None values from regex searches and checking for uninitialized contract types before string operations—as well as removing a redundant early exit check that breaks docstring formatting and eliminating a duplicate view entry in the manifest.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread intervention_compassion/models/compassion_intervention.py Outdated
Comment thread survival_sponsorship_compassion/models/contracts_report.py Outdated
Comment thread partner_communication_compassion/models/contracts.py
Comment thread survival_sponsorship_compassion/__manifest__.py Outdated
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

One contained issue should be fixed before merging.

Most changes are localized, but the new FY regex currently prevents normal fiscal-year intervention names from matching the previous year.

intervention_compassion/models/compassion_intervention.py

T-Rex T-Rex Logs

What T-Rex did

  • The team ran a targeted Python harness to validate FY parsing, search_value, and the product_template_id copy branch; it reproduced that the current digit regex produced no match, left year_str as None, and yielded an empty search_value with no product_template_id copied, while the harness also demonstrated that the correct digit regex would extract 25, yield Program FY24, locate the fake prior intervention, and copy product_template_id 4242.
  • The team inspected the pre-run and post-run states of the departure sponsorship and cleanup sequence; before the run pending logic was disabled and invoice cleanup ran immediately, and after the run the terminated departure sponsorship type S was computed pending true with cleanup deferred for non-pending items; after send/cancel finalization exit job contracts were stamped, still-pending terminated departures received deferred cleanup, active contracts were stamped, and non-exit jobs remained untouched.
  • Artifacts were prepared to support review, including the Python repro artifact and its execution output, plus related items documenting the pre/post-run validation steps.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
intervention_compassion/models/compassion_intervention.py Adds regex-based FY parsing for prior intervention lookup, but the escaped digit pattern prevents normal FY names from matching.
partner_communication_compassion/models/contracts.py Adds computed pending-exit communication state and defers invoice cleanup while that state is active.
partner_communication_compassion/models/partner_communication.py Moves exit communication finalization into shared helper paths for sent and canceled jobs.
partner_communication_compassion/views/partner_compassion_view.xml Adds pending-exit decorations and includes the computed field in the sponsorship list payload.
partner_communication_compassion/views/contract_view.xml Adds the pending-exit field to the SDS follow-up kanban and displays a warning marker.
sponsorship_compassion/models/res_partner.py Allows smart tag modification in the anonymization context so tag cleanup can proceed during partner anonymization.
sbc_compassion/models/import_letters_history.py Casts failed file names to strings before appending them to the import error log.
partner_communication_compassion/manifest.py Bumps the module version and adds the dependency needed by the new inherited view.
survival_sponsorship_compassion/data/survival_product_template.xml Reorders the survival product template fields without changing values.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Staff as Staff termination
participant Contract as recurring.contract
participant Comm as partner.communication.job
participant Sponsor as Sponsor-facing invoices/UI

Staff->>Contract: terminate child departure
Contract->>Contract: compute exit_communication_pending
Contract-->>Sponsor: defer invoice cleanup while pending
Contract->>Comm: exit communication job
Comm->>Comm: _job_sent(send_mode)
Comm->>Contract: set exit_communication_sent
Comm->>Contract: cancel_contract_invoices()
Contract-->>Sponsor: apply invoice cleanup after notification
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Staff as Staff termination
participant Contract as recurring.contract
participant Comm as partner.communication.job
participant Sponsor as Sponsor-facing invoices/UI

Staff->>Contract: terminate child departure
Contract->>Contract: compute exit_communication_pending
Contract-->>Sponsor: defer invoice cleanup while pending
Contract->>Comm: exit communication job
Comm->>Comm: _job_sent(send_mode)
Comm->>Contract: set exit_communication_sent
Comm->>Contract: cancel_contract_invoices()
Contract-->>Sponsor: apply invoice cleanup after notification
Loading

Reviews (3): Last reviewed commit: "Update intervention_compassion/models/co..." | Re-trigger Greptile

Comment thread partner_communication_compassion/models/partner_communication.py
@ecino ecino force-pushed the 18.0-ff branch 2 times, most recently from a24a229 to 7fa79c8 Compare July 9, 2026 07:57
Comment thread partner_communication_compassion/views/partner_compassion_view.xml
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Comment on lines +426 to +427
match = re.search(r"\\d+", split_name[1])
year_str = match.group() if match else None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Fix digit regex
r"\\d+" matches a literal backslash followed by d, not digits, so normal names like ...FY25 never set year_str. That makes search_value empty and skips copying the previous fiscal year's product_template_id, changing the created intervention data for every FY-based import.

Artifacts

Repro: Python harness for FY regex and product copy branch

  • Contains supporting evidence from the run (text/x-python; charset=utf-8).

Repro: harness execution output showing empty search_value and skipped copy

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

@ecino ecino merged commit f930c62 into 18.0 Jul 9, 2026
2 checks passed
@ecino ecino deleted the 18.0-ff branch July 9, 2026 08: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