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
Merge requests
!25
Added the management of configuration settings in JSON RPC import of CSV files.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Added the management of configuration settings in JSON RPC import of CSV files.
topic/default/TG-407
into
branch/default
Overview
0
Commits
1
Pipelines
0
Changes
5
Closed
Etienne Ferriere
requested to merge
topic/default/TG-407
into
branch/default
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
6
Expand
0
0
Merge request reports
Compare
version 2
version 4
6df809ef
3 years ago
version 3
a39778bb
3 years ago
version 2
88472db0
3 years ago
version 1
bf4a1ea3
3 years ago
branch/default (base)
and
version 3
latest version
44baa363
1 commit,
3 years ago
version 4
6df809ef
1 commit,
3 years ago
version 3
a39778bb
1 commit,
3 years ago
version 2
88472db0
1 commit,
3 years ago
version 1
bf4a1ea3
1 commit,
3 years ago
Show latest version
6 files
+
100
−
24
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
odoo_scripts/actions.py
0 → 100644
+
85
−
0
Options
#!/usr/bin/env python3
"""
Post import CSV setup script.
"""
import
logging
import
sys
from
.odoo
import
odoo_connect_parser
,
odoo_login
from
.parsing
import
logging_from_verbose
_logger
=
logging
.
getLogger
(
__name__
)
__version__
=
"
1.0.0
"
__date__
=
"
2021-03-31
"
__updated__
=
"
2021-03-31
"
def
do_actions
(
login
:
str
,
password
:
str
,
database
:
str
,
protocol
:
str
,
host
:
str
,
port
:
int
,
timeout
:
int
,
)
->
int
:
o
,
session_id
=
odoo_login
(
database
,
host
,
login
,
password
,
port
,
protocol
,
timeout
)
# Update configuration settings.
_logger
.
info
(
"
Uninstall configuration settings
"
)
setting_ids
=
o
.
env
[
"
res.config.settings
"
].
search
([])
if
setting_ids
:
o
.
execute
(
"
res.config.settings
"
,
"
execute
"
,
setting_ids
)
o
.
env
[
"
res.config.settings
"
].
unlink
(
setting_ids
)
return
0
def
main
(
argv
=
None
):
# IGNORE:C0111
"""
Parse arguments and launch conversion
"""
program_version
=
__version__
program_build_date
=
str
(
__updated__
)
program_version_message
=
"
%%(prog)s %s (%s)
"
%
(
program_version
,
program_build_date
,
)
program_shortdesc
=
__doc__
.
split
(
"
.
"
)[
0
]
program_license
=
"""
%s
Created by Vincent Hatakeyama on %s.
Copyright 2021 XCG Consulting. All rights reserved.
Licensed under the MIT License
Distributed on an
"
AS IS
"
basis without warranties
or conditions of any kind, either express or implied.
USAGE
"""
%
(
program_shortdesc
,
str
(
__date__
),
)
# Argument parsing
parser
=
odoo_connect_parser
(
program_license
,
program_version_message
)
nmspc
=
parser
.
parse_args
(
argv
)
logging_from_verbose
(
nmspc
)
return
do_actions
(
login
=
nmspc
.
login
,
password
=
nmspc
.
password
,
port
=
nmspc
.
port
,
host
=
nmspc
.
host
,
protocol
=
nmspc
.
protocol
,
timeout
=
nmspc
.
timeout
,
database
=
nmspc
.
database
,
)
if
__name__
==
"
__main__
"
:
return_code
=
main
(
sys
.
argv
[
1
:])
if
return_code
:
exit
(
return_code
)
Loading