From 1e9a7e6d00ea8ed1acde381987f4416bc7a0f345 Mon Sep 17 00:00:00 2001 From: nans Date: Wed, 20 Jan 2021 23:28:08 +0100 Subject: [PATCH] [IMP] base_jsonify: cache json parser --- base_jsonify/models/ir_export.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base_jsonify/models/ir_export.py b/base_jsonify/models/ir_export.py index 19cea8c14..92357a561 100644 --- a/base_jsonify/models/ir_export.py +++ b/base_jsonify/models/ir_export.py @@ -5,6 +5,7 @@ from collections import OrderedDict from odoo import fields, models +from odoo.tools import ormcache def partition(l, accessor): @@ -88,6 +89,11 @@ class IrExport(models.Model): help="If set, will apply the global resolver to the result", ) + @ormcache( + "self.language_agnostic", + "self.global_resolver_id.id", + "tuple(self.export_fields.mapped('write_date'))", + ) def get_json_parser(self): """Creates a parser from ir.exports record and return it.