[IMP] base_jsonify: cache json parser

pull/2418/head
nans 2021-01-20 23:28:08 +01:00 committed by Sébastien BEAU
parent d30ea05fcf
commit 1e9a7e6d00
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@
from collections import OrderedDict from collections import OrderedDict
from odoo import fields, models from odoo import fields, models
from odoo.tools import ormcache
def partition(l, accessor): def partition(l, accessor):
@ -88,6 +89,11 @@ class IrExport(models.Model):
help="If set, will apply the global resolver to the result", 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): def get_json_parser(self):
"""Creates a parser from ir.exports record and return it. """Creates a parser from ir.exports record and return it.