[FIX] deltatech_stock_inventory: clear inventory note after applying (18.0) - #2829
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
action_apply_inventoryresets onlyinventory_id/inventory_line_id, and the standardaction_clear_inventory_quantitydoes not touch custom fields. Confirmed empirically on the customer's production database: after applying,inventory_notewas still set on the quant, so it would silently become the reference of the next adjustment on the same product.msgid "Inventory Note"had an emptymsgstr, 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.htmlare 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