The Odoo framework provides the ormcache decorator to manage the in-memory cache. In this recipe, we will explore how you can manage the cache for your functions.
The in-memory cache – ormcache
How to do it...
The classes of this ORM cache are available at /odoo/tools/cache.py. In order to use these in any file, you will need to import them as follows:
from odoo import tools
After importing the classes, you can use the ORM cache decorators. Odoo provides different types of in-memory cache decorator. We'll take a look at each of these in the following sections.