# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1582112499 -3600 # Wed Feb 19 12:41:39 2020 +0100 # Node ID 7bd2beb6ef71745ca7db6f97b02bbae599865f42 # Parent 9d4ed62e0c336262351ad34c947cd1a08b8ac417 📠handle new data types more correctly in import jsonrpc diff --git a/odoo_scripts/import_jsonrpc.py b/odoo_scripts/import_jsonrpc.py --- a/odoo_scripts/import_jsonrpc.py +++ b/odoo_scripts/import_jsonrpc.py @@ -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