From 4bcfa70dbe24542a385609cefe8860c645ae896e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Fri, 15 Nov 2024 12:51:26 +0100 Subject: [PATCH] [FIX] *: avoid waring of invalidate_cache() --- .../tests/test_weight_from_packaging.py | 2 +- stock_restrict_lot/tests/test_restrict_lot.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/delivery_total_weight_from_packaging/tests/test_weight_from_packaging.py b/delivery_total_weight_from_packaging/tests/test_weight_from_packaging.py index 5caa6135bfa1..61f2adcde352 100644 --- a/delivery_total_weight_from_packaging/tests/test_weight_from_packaging.py +++ b/delivery_total_weight_from_packaging/tests/test_weight_from_packaging.py @@ -55,7 +55,7 @@ def test_picking_shipping_weight(self): # Check shipping weight knowing there is no shipping weight on the package self.assertEqual(picking.shipping_weight, 16) pack.shipping_weight = 6 - picking.invalidate_cache(["shipping_weight"]) + picking.invalidate_model(["shipping_weight"]) self.assertEqual(picking.shipping_weight, 15) picking._action_done() # Check the manualy set weight is not lost when quants are inserted in the package diff --git a/stock_restrict_lot/tests/test_restrict_lot.py b/stock_restrict_lot/tests/test_restrict_lot.py index e349aca42e6d..d01ec0598ef7 100644 --- a/stock_restrict_lot/tests/test_restrict_lot.py +++ b/stock_restrict_lot/tests/test_restrict_lot.py @@ -294,11 +294,11 @@ def test_compute_quantites(self): product = move.product_id self.assertEqual(product.outgoing_qty, 2) - product.invalidate_cache() + product.env.invalidate_all() product = product.with_context(lot_id=self.lot.id) self.assertEqual(product.outgoing_qty, 1) - product.invalidate_cache() + product.env.invalidate_all() product = product.with_context(lot_id=lot2.id) self.assertEqual(product.outgoing_qty, 1)