Skip to content
Snippets Groups Projects
Commit 7bd2beb6ef71 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: handle new data types more correctly in import jsonrpc

parent 9d4ed62e0c33
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,9 @@
def _convert_int(value) -> int:
return int(value)
def _convert_float(value) -> float:
return float(value)
def _convert_many2one(xmlid: str) -> int:
if xmlid:
return _ref(xmlid)
......@@ -112,7 +115,12 @@
)
if ttype == "boolean":
converter = _convert_bool
elif ttype in ("char", "text", "selection"):
elif ttype in (
"char",
"text",
"selection",
"date",
):
converter = _convert_identity
elif ttype in ("many2one",):
converter = _convert_many2one
......@@ -120,6 +128,8 @@
converter = _convert_many2many
elif ttype in ("integer",):
converter = _convert_int
elif ttype in ("float",):
converter = _convert_float
else:
_logger.warning("Unknown field type %s", ttype)
converter = _convert_identity
......
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