[FIX] if the json value is [] it return {} instead

pull/2533/head
Sébastien BEAU 2019-05-29 10:31:56 +02:00 committed by hda
parent d24cc7e4eb
commit ed95257f55
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ from odoo import fields
def convert_to_cache(self, value, record, validate=True):
# cache format: dict / list
value = value or {}
if value is False:
value = {}
return value if isinstance(value, (dict, list)) else json.loads(value)