Skip to content
Snippets Groups Projects
Commit 5abcff85 authored by Ajay Javiya's avatar Ajay Javiya Committed by Raphael Collet
Browse files

[FIX] fields: add minimal support for serialized fields in new API

This is necessary for supporting old-api sparse and serialized fields.  Without
this, old-api serialized fields are broken because they cannot be converted to
new-api fields.

This closes #4571
parent 1eb25070
No related branches found
No related tags found
No related merge requests found
......@@ -1751,6 +1751,14 @@ class Many2many(_RelationalMulti):
_column_limit = property(attrgetter('limit'))
class Serialized(Field):
""" Minimal support for existing sparse and serialized fields. """
type = 'serialized'
def convert_to_cache(self, value, record, validate=True):
return value or {}
class Id(Field):
""" Special case for field 'id'. """
store = True
......@@ -1774,7 +1782,6 @@ class Id(Field):
def __set__(self, record, value):
raise TypeError("field 'id' cannot be assigned")
# imported here to avoid dependency cycle issues
from openerp import SUPERUSER_ID
from .exceptions import Warning, AccessError, MissingError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment