Skip to content

T3469 FIX last payment computation - #288

Merged
ecino merged 1 commit into
18.0from
T3469-fix-last-payment
Oct 1, 2026
Merged

ecino merged 1 commit into
18.0from
T3469-fix-last-payment

Conversation

@ecino

@ecino ecino commented Oct 1, 2026

Copy link
Copy Markdown
Member
  • In some cases the last payment was not set when it was not coming from a banking statement (online payments for instance).

- In some cases the last payment was not set when it was not coming from a banking statement (online payments for instance).
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Changes payment date computation logic for recurring contracts.

Do not merge until mixed payments retain the latest payment date. The missing tests are a separate, non-blocking concern.

Findings

  1. P1 Mixed payments lose dates ▶
  2. P2 Payment dates lack tests ▶

Reviews (1) · Last reviewed commit: "T3469 FIX last payment computation"

Comment on lines +77 to 80
if st_lines:
payment_dates.extend(st_lines.mapped("date"))
else:
payment_dates.extend(payment_lines.mapped("date"))

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 Mixed payments lose dates

When a statement-backed payment and a later online payment fully reconcile one invoice, this branch finds the statement and excludes the online payment date. The invoice can therefore retain the earlier date as last_payment. The monthly thank-you summary filters by that field, so it can place the invoice in the wrong month. Apply the fallback separately to payments without a statement. This needs to be fixed before merging.

Artifacts

Mixed-payment compute reproduction script

  • The authored script executes each revision's compute method against the same mocked reconciliation group, making the date-selection comparison reproducible.

Parent compute result with mixed payments

  • Running the parent method from /home/user/repo returned the later online date with exit code 0, establishing the comparison result.

Candidate compute result with mixed payments

  • Running the candidate method from /home/user/repo returned the earlier statement date and failed the assertion with exit code 1, showing the regression in the mocked case.

Authored last-payment execution script

  • The authored script loads and executes the payment computation from a selected Git revision against synthetic records, making the limited check reproducible.

Repository payment-test search

  • A repository search located the payment helper and last-payment implementation but no Python assertion of the computed field, confirming the coverage gap.

Parent-revision payment computation

  • Executing the parent revision against four synthetic payment cases produced three dates that did not match expectations.

PR candidate payment computation

  • Executing the candidate against the same four synthetic cases produced all expected dates, without establishing Odoo integration behavior.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment on lines +77 to 80
if st_lines:
payment_dates.extend(st_lines.mapped("date"))
else:
payment_dates.extend(payment_lines.mapped("date"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Payment dates lack tests

The existing payment helper creates a payment but never asserts last_payment. There are no tests for the new no-statement fallback or an invoice with mixed payments, so another date-selection error could reach invoice reporting without a test catching it. This is a non-blocking test-coverage concern.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Artifacts

Mixed-payment compute reproduction script

  • The authored script executes each revision's compute method against the same mocked reconciliation group, making the date-selection comparison reproducible.

Parent compute result with mixed payments

  • Running the parent method from /home/user/repo returned the later online date with exit code 0, establishing the comparison result.

Candidate compute result with mixed payments

  • Running the candidate method from /home/user/repo returned the earlier statement date and failed the assertion with exit code 1, showing the regression in the mocked case.

Authored last-payment execution script

  • The authored script loads and executes the payment computation from a selected Git revision against synthetic records, making the limited check reproducible.

Repository payment-test search

  • A repository search located the payment helper and last-payment implementation but no Python assertion of the computed field, confirming the coverage gap.

Parent-revision payment computation

  • Executing the parent revision against four synthetic payment cases produced three dates that did not match expectations.

PR candidate payment computation

  • Executing the candidate against the same four synthetic cases produced all expected dates, without establishing Odoo integration behavior.

View artifacts

T-Rex Ran code and verified through T-Rex

@ecino
ecino merged commit ab3e780 into 18.0 Oct 1, 2026
2 checks passed
@ecino
ecino deleted the T3469-fix-last-payment branch October 1, 2026 13:28
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