Skip to content

[FIX] deltatech_stock_inventory: clear inventory note after applying (18.0) - #2829

Merged
dhongu merged 1 commit into
18.0from
18.0-fix-inventory-note-cleanup
Aug 17, 2026
Merged

[FIX] deltatech_stock_inventory: clear inventory note after applying (18.0)#2829
dhongu merged 1 commit into
18.0from
18.0-fix-inventory-note-cleanup

Conversation

@dhongu

@dhongu dhongu commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Backport of the applicable part of PR #2794 (19.0), found while working helpdesk ticket #9156 (AGROAMAT).

The 19.0 regression that PR fixed — the per-line Inventory Note never reaching the generated stock move — never existed on 18.0: values["name"] = self.inventory_note or values["name"] has always been active here. Verified on the customer's 18.0 production database: an adjustment with a note produces a stock move whose reference is that note.

Two real defects do exist on 18.0, and this PR fixes both:

  1. The note is never cleared. action_apply_inventory resets only inventory_id/inventory_line_id, and the standard action_clear_inventory_quantity does not touch custom fields. Confirmed empirically on the customer's production database: after applying, inventory_note was still set on the quant, so it would silently become the reference of the next adjustment on the same product.
  2. The column label was untranslatedmsgid "Inventory Note" had an empty msgstr, so operators saw it in English.

Adds three tests (32 tests total on the module, 0 failures locally on 18.0). One of them documents a behaviour worth knowing: the user name the standard appends to the move reference comes from user_id (Assigned To), not from the user performing the adjustment — so the per-line note is the only per-product trace of the reason.

README.rst / static/description/index.html are left out of this commit on purpose: they carry uncommitted regeneration from another session in this worktree, and they are generated files.

🤖 Generated with Claude Code

The per-line Inventory Note was carried over to the generated stock move, but
never cleared afterwards: action_apply_inventory only resets inventory_id and
inventory_line_id, and the standard action_clear_inventory_quantity does not
touch custom fields. A note left over from a previous count silently became the
reference of the next adjustment on the same quant, so the move history showed a
reason that belonged to an earlier operation.

Confirmed on the customer's 18.0 production database (ticket #9156): after
applying an adjustment, inventory_note was still set on the quant.

Also adds the missing Romanian translation of the column label, which operators
saw in English, and tests for both behaviours. One of the tests documents that
the user name the standard appends to the reference comes from user_id
(*Assigned To*), not from the user performing the adjustment — so the per-line
note is the only per-product trace of the reason.

This is a backport of the applicable part of PR #2794 (19.0). The 19.0 regression
it fixed — the note not reaching the move at all — never existed on 18.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.54%. Comparing base (2ebbf74) to head (7222246).

Additional details and impacted files
@@            Coverage Diff             @@
##             18.0    #2829      +/-   ##
==========================================
+ Coverage   74.50%   74.54%   +0.03%     
==========================================
  Files        1278     1279       +1     
  Lines       22018    22051      +33     
  Branches     2981     2981              
==========================================
+ Hits        16405    16438      +33     
  Misses       4737     4737              
  Partials      876      876              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dhongu
dhongu merged commit 81824ac into 18.0 Aug 17, 2026
5 checks passed
@dhongu
dhongu deleted the 18.0-fix-inventory-note-cleanup branch August 17, 2026 09: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