[FIX] stock_account_cost_revaluation: link the revaluation entry to the value adjustment - #937
Open
rov-adhoc wants to merge 1 commit into
Open
[FIX] stock_account_cost_revaluation: link the revaluation entry to the value adjustment#937rov-adhoc wants to merge 1 commit into
rov-adhoc wants to merge 1 commit into
Conversation
Contributor
…he value adjustment Task 64440, functional feedback. Changing the accounting cost of a product with perpetual valuation posts the revaluation entry here, but the ``product.value`` the standard records for that same price change was left with no reference to it. ``stock_account_ux`` reads "no entry" as "still part of the difference to adjust", so the adjustment kept showing up as pending in the inventory valuation report and the closing booked it a second time — telling booked from pending is the whole point of that field. ``_link_cost_revaluation_entry`` points the record at the entry right after posting it: the most recent price change of the product in the company still without an entry, which is the one ``_change_standard_price`` just created. Lot price changes are left alone —they record their own ``product.value`` and this entry values the product's on-hand stock, not a lot's. When no entry is posted (no revaluation account, no stock, FIFO, periodic category) there is nothing to link and the adjustment stays pending, as it should. ``stock_account_ux`` joins ``depends``: it is where ``account_move_id`` comes from. It is ``auto_install`` over ``stock_account``, which this module already depends on, so it is installed in every database that has this one anyway. Test plan: 2 new tests, 9 green in the module on a fresh database. The linking one is red without the fix.
rov-adhoc
force-pushed
the
19.0-t-64440-rov
branch
from
August 25, 2026 12:03
e802f7d to
e580482
Compare
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.

Changing the accounting cost (
standard_price) of a product with perpetual valuation posts the revaluation entry in this module, but theproduct.valuethe standard records for that same price change was left with no reference to it.stock_account_uxreads "no entry" as "still part of the difference to adjust", so the adjustment kept showing up as pending in the inventory valuation report and the inventory closing booked it a second time. Telling booked from pending is the whole point of that field.What changes
_link_cost_revaluation_entrypoints theproduct.valueat the entry right after posting it: the most recent price change of the product in the company still without an entry, which is the one_change_standard_pricejust created.product.value, and this entry values the product's on-hand stock, not a lot's.stock_account_uxjoinsdepends: it is whereaccount_move_idcomes from. It isauto_installoverstock_account, which this module already depends on, so it is installed in every database that has this one anyway.Test plan
2 new tests in
test_cost_revaluation, 9 green in the module on a fresh database with demo data. The linking one is red without the fix.Related
Same branch name as, and part of the same functional review round as, ingadhoc/account-financial-tools#984 and ingadhoc/stock#1004 — runbot builds the three together.
Task: https://www.adhoc.inc/odoo/project.task/64440