From 717cb6c944e4d6c3effc381efd38e4fb03f44781 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Mon, 3 Oct 2022 16:01:03 +0200 Subject: [PATCH] [FIX] base_changeset: fix caching ormcache is used to minimize the number of times that the active changeset rules are quered, but it was still missing in one important place. In this module's tests, this reduces the number of calls to `models_to_track_changeset` from 354 to 135 times, and the number of test queries is reduced from 4069 to 3810. --- base_changeset/models/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_changeset/models/base.py b/base_changeset/models/base.py index fabcbe392..198d591ec 100644 --- a/base_changeset/models/base.py +++ b/base_changeset/models/base.py @@ -4,7 +4,7 @@ from lxml import etree from odoo import _, api, fields, models -from odoo.tools import config +from odoo.tools import config, ormcache class Base(models.AbstractModel): @@ -58,6 +58,7 @@ class Base(models.AbstractModel): rec.count_pending_changeset_changes = 0.0 @api.model + @ormcache(skiparg=1) def models_to_track_changeset(self): """Models to be tracked for changes :args: