From 6ce294fa522934af563d2c9e274243ba2ecf2b5c Mon Sep 17 00:00:00 2001 From: Andrew Gavgavian Date: Fri, 19 Jan 2024 15:12:56 -0800 Subject: [PATCH] [FIX] base: swap regen asset bundle to registry cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since [1] `model.clear_cache` is no longer recommended. Most models were changed besides the function responsible for regenerating asset bundles. This leads to a deprecation warning when pressing the button in the debug menu in 16.4+ 1: #119813 opw-3694331 closes odoo/odoo#150948 X-original-commit: ef0db39416c678a3a3e53ddb97971f87e912f44c Signed-off-by: Rémy Voet (ryv) Signed-off-by: Andrew Gavgavian (andg) --- odoo/addons/base/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_attachment.py b/odoo/addons/base/models/ir_attachment.py index 45ce5036c95..fecb1b01bcc 100644 --- a/odoo/addons/base/models/ir_attachment.py +++ b/odoo/addons/base/models/ir_attachment.py @@ -739,4 +739,4 @@ class IrAttachment(models.Model): ('res_id', '=', 0), ('create_uid', '=', SUPERUSER_ID), ]).unlink() - self.clear_caches() + self.env.registry.clear_cache('assets')