Skip to content

Commit

Permalink
[MIG] stock_valuation_layer_total_value: Migration to 16.0 and modify…
Browse files Browse the repository at this point in the history
… test
  • Loading branch information
PauBForgeFlow committed Nov 2, 2023
1 parent 2875cec commit bf34f7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stock_valuation_layer_total_value/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Stock Valuation Layer Total Value",
"summary": "Show total value on tree and form view",
"version": "14.0.0.0.0",
"version": "16.0.1.0.0",
"development_status": "Production/Stable",
"category": "stock",
"website": "https://github.com/OCA/stock-logistics-warehouse",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Copyright 2022 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests import tagged

from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import (
ValuationReconciliationTestCommon,
)


@tagged("-at_install", "post_install")
class TestValuationLayerTotalValue(ValuationReconciliationTestCommon):
@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -72,11 +75,12 @@ def test_valuation_layer_values(self):
move1 = self._make_in_move(self.product1, 10, unit_cost=10, create_picking=True)
move2 = self._make_in_move(self.product1, 5, unit_cost=15, create_picking=True)
original_svl = move1.stock_valuation_layer_ids
total_value_original = original_svl.total_value_with_additional_costs
new_svl = move2.stock_valuation_layer_ids
original_svl.write({"stock_valuation_layer_ids": [(4, new_svl.id)]})
self.assertEqual(
original_svl.total_value_with_additional_costs,
original_svl.total_value_with_additional_costs + new_svl.value,
total_value_original + new_svl.value,
)
self.assertEqual(
original_svl.unit_price_with_extra_cost,
Expand Down

0 comments on commit bf34f7a

Please sign in to comment.