Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
7bd2beb6ef71
Commit
7bd2beb6ef71
authored
5 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
handle new data types more correctly in import jsonrpc
parent
9d4ed62e0c33
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
odoo_scripts/import_jsonrpc.py
+11
-1
11 additions, 1 deletion
odoo_scripts/import_jsonrpc.py
with
11 additions
and
1 deletion
odoo_scripts/import_jsonrpc.py
+
11
−
1
View file @
7bd2beb6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment