diff --git a/stock_inventory_revaluation/tests/test_stock_inventory_revaluation.py b/stock_inventory_revaluation/tests/test_stock_inventory_revaluation.py index 167cdf009..1a976d88f 100644 --- a/stock_inventory_revaluation/tests/test_stock_inventory_revaluation.py +++ b/stock_inventory_revaluation/tests/test_stock_inventory_revaluation.py @@ -6,6 +6,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase +from openerp import exceptions from datetime import datetime from datetime import date, timedelta @@ -295,6 +296,12 @@ class TestStockInventoryRevaluation(TransactionCase): invent_value_change.account_move_ids[0].line_ids), 2, 'Incorrect accounting entry generated') + with self.assertRaises(exceptions.Warning): + invent_value_change.account_move_ids.unlink() + + with self.assertRaises(exceptions.Warning): + invent_value_change.account_move_ids[0].line_ids.unlink() + for move_line in invent_value_change.account_move_ids[0].line_ids: if move_line.account_id == self.account_inventory: self.assertEqual(move_line.credit, 50.0,