Skip to content

[14.0][FIX] account_asset_transfer_extension: prevent deletion of AUC transfer moves#860

Merged
eantones merged 3 commits into14.0from
14.0-fix-account_asset_transfer_extension-prevent_curs_move_deletion
Mar 16, 2026
Merged

[14.0][FIX] account_asset_transfer_extension: prevent deletion of AUC transfer moves#860
eantones merged 3 commits into14.0from
14.0-fix-account_asset_transfer_extension-prevent_curs_move_deletion

Conversation

@eantones
Copy link
Copy Markdown
Member

Summary

  • Prevent unlink_move() from deleting AUC transfer moves (CURS journal entries) when a user clicks "unpost" on a to_asset's init_entry depreciation line
  • The bug caused the CURS move to be permanently deleted, leaving from_assets with transfer_move_id = NULL and the revert wizard showing "Nothing to revert"
  • Add override of unlink_move() on account.asset.line that raises UserError if the move is referenced by transfer_move_id on any asset

Test plan

  • Create a transfer (AUC → final assets) via the transfer wizard
  • Open a to_asset, go to depreciation board, try to "unpost" the init_entry (type=create) line
  • Verify that a UserError is raised with the message directing to use "Revert Transfer" instead
  • Verify that normal depreciation lines can still be unposted without issues
  • Verify that the "Revert Transfer" wizard still works correctly

@eantones eantones force-pushed the 14.0-fix-account_asset_transfer_extension-prevent_curs_move_deletion branch from 79843a2 to 453db2c Compare March 16, 2026 13:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.62%. Comparing base (b45d2b3) to head (33f8a3d).
⚠️ Report is 4 commits behind head on 14.0.

Files with missing lines Patch % Lines
...et_transfer_extension/models/account_asset_line.py 45.45% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             14.0     #860      +/-   ##
==========================================
- Coverage   50.62%   50.62%   -0.01%     
==========================================
  Files         971      972       +1     
  Lines       16406    16418      +12     
  Branches     3496     3500       +4     
==========================================
+ Hits         8306     8312       +6     
- Misses       7887     7893       +6     
  Partials      213      213              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eantones eantones force-pushed the 14.0-fix-account_asset_transfer_extension-prevent_curs_move_deletion branch 2 times, most recently from 50192c5 to 2bac0a2 Compare March 16, 2026 14:15
…fer moves

When a user clicks "unpost" on the init_entry depreciation line of a
to_asset, the unlink_move() method deletes the linked move. Since the
init_entry points to the CURS transfer move, this causes the transfer
move to be permanently deleted. The from_assets lose their
transfer_move_id (set to NULL by ondelete), and the revert wizard shows
"Nothing to revert" because it can no longer find the to_assets.

Add an override of unlink_move() on account.asset.line that checks
whether the move being deleted is referenced as transfer_move_id by any
asset. If so, raise a UserError directing the user to use the "Revert
Transfer" action instead.
Add complete ca.po translation for all existing module strings.
Add readme/DESCRIPTION.rst and readme/CONTRIBUTORS.rst with module
description and contributor list. Regenerate README.rst.
@eantones eantones force-pushed the 14.0-fix-account_asset_transfer_extension-prevent_curs_move_deletion branch from 2bac0a2 to 33f8a3d Compare March 16, 2026 14:20
@eantones eantones merged commit 48f3160 into 14.0 Mar 16, 2026
12 of 13 checks passed
@eantones eantones deleted the 14.0-fix-account_asset_transfer_extension-prevent_curs_move_deletion branch March 16, 2026 14:53
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