[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.
pull/2380/head
Stefan Rijnhart 2022-10-03 16:01:03 +02:00 committed by Miquel Raïch
parent de364cbaa3
commit 717cb6c944
1 changed files with 2 additions and 1 deletions

View File

@ -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: