REName base_sparse_field to base_sparse_field_list_support with only monkey patch
parent
5ca1105b11
commit
0016f9cf72
|
@ -0,0 +1,2 @@
|
||||||
|
# coding: utf-8
|
||||||
|
from . import models
|
|
@ -0,0 +1,15 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
{
|
||||||
|
"name": "Base Sparse Field List Support",
|
||||||
|
"summary": "add list support to convert_to_cache()",
|
||||||
|
"version": "8.0.1.0.0",
|
||||||
|
'category': 'Technical Settings',
|
||||||
|
"website": "www.akretion.com",
|
||||||
|
"author": " Akretion",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"application": False,
|
||||||
|
"installable": True,
|
||||||
|
"depends": [
|
||||||
|
"base",
|
||||||
|
],
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
# coding: utf-8
|
||||||
|
from . import fields
|
|
@ -0,0 +1,18 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
from odoo import fields
|
||||||
|
|
||||||
|
#
|
||||||
|
# Definition and implementation of serialized fields: override
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_cache(self, value, record, validate=True):
|
||||||
|
# cache format: dict / list
|
||||||
|
value = value or {}
|
||||||
|
return value if isinstance(value, (dict, list)) else json.loads(value)
|
||||||
|
|
||||||
|
|
||||||
|
fields.Serialized.convert_to_cache = convert_to_cache
|
Loading…
Reference in New Issue