Skip to content

fix(party): Transaction Health incorrect false positives on amended docs#49

Merged
Sendipad merged 1 commit intodevelopfrom
fix-transaction-health-amended-logic
Feb 26, 2026
Merged

fix(party): Transaction Health incorrect false positives on amended docs#49
Sendipad merged 1 commit intodevelopfrom
fix-transaction-health-amended-logic

Conversation

@Sendipad
Copy link
Copy Markdown
Owner

@Sendipad Sendipad commented Feb 26, 2026

The code formerly checked the `amended_from` field on the canceled document itself, which is always empty. This fix refactors the logic to check if another document has an `amended_from` pointing to the canceled document's name, accurately aligning with standard Frappe tracking behavior.

Changes:

  • Refactored scan queries for both standard and child doctypes in `run_transaction_policy_scan`
  • Updated resolving logic inside `sync_transaction_health_issues`
  • Fixed tally in `get_health_counts`
  • Created robust unit test coverage in `test_transaction_health.py`"

This fixes an issue where cancelled Sales Invoices that were amended still showed up as unamended. The logic incorrectly checked amended_from on the cancelled document itself rather than checking if another document had an amended_from pointing to it.
@Sendipad Sendipad marked this pull request as ready for review February 26, 2026 19:19
@Sendipad Sendipad merged commit be513cb into develop Feb 26, 2026
6 checks passed
@Sendipad Sendipad deleted the fix-transaction-health-amended-logic branch February 26, 2026 19:20
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