From 88e163b4fd76ccaeee91b4af7c2306b8e8ed6611 Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Thu, 2 Feb 2023 16:32:16 +0100 Subject: [PATCH] Fix stock_release_channel_auto_release backward port to 14 --- stock_release_channel_auto_release/__manifest__.py | 2 +- .../models/stock_release_channel.py | 2 +- .../tests/test_channel_release_auto.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stock_release_channel_auto_release/__manifest__.py b/stock_release_channel_auto_release/__manifest__.py index 59d41a2fb3d..3108faac7f5 100644 --- a/stock_release_channel_auto_release/__manifest__.py +++ b/stock_release_channel_auto_release/__manifest__.py @@ -5,7 +5,7 @@ "name": "Stock Release Channel Auto Release", "summary": """ Add an automatic release mode to the release channel""", - "version": "16.0.1.0.0", + "version": "14.0.1.0.0", "license": "AGPL-3", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/wms", diff --git a/stock_release_channel_auto_release/models/stock_release_channel.py b/stock_release_channel_auto_release/models/stock_release_channel.py index 19458212b89..f7c13b576f1 100644 --- a/stock_release_channel_auto_release/models/stock_release_channel.py +++ b/stock_release_channel_auto_release/models/stock_release_channel.py @@ -58,7 +58,7 @@ def write(self, vals): res = super().write(vals) release_mode = vals.get("release_mode") if release_mode == "auto": - self.invalidate_recordset(["is_auto_release_allowed"]) + self.invalidate_cache(["is_auto_release_allowed"]) self.auto_release_all() return res diff --git a/stock_release_channel_auto_release/tests/test_channel_release_auto.py b/stock_release_channel_auto_release/tests/test_channel_release_auto.py index 73e7e0009c6..16c53273289 100644 --- a/stock_release_channel_auto_release/tests/test_channel_release_auto.py +++ b/stock_release_channel_auto_release/tests/test_channel_release_auto.py @@ -18,7 +18,7 @@ def setUpClass(cls): cls._update_qty_in_location(cls.loc_bin1, cls.product2, 1000.0) # invalidate cache for computed fields bases on qty in stock - cls.env.invalidate_all() + cls.env["product.product"].invalidate_cache() @contextmanager def assert_release_job_enqueued(self, channel):