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
ef1ff60532b7
Commit
ef1ff60532b7
authored
3 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
Add populate options to docker_dev_start
parent
efa11618135c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!90
✨ Add populate options to docker_dev_start
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NEWS.rst
+2
-0
2 additions, 0 deletions
NEWS.rst
odoo_scripts/config.py
+16
-0
16 additions, 0 deletions
odoo_scripts/config.py
odoo_scripts/docker_dev_start.py
+53
-10
53 additions, 10 deletions
odoo_scripts/docker_dev_start.py
with
71 additions
and
10 deletions
NEWS.rst
+
2
−
0
View file @
ef1ff605
...
...
@@ -11,6 +11,8 @@
Fix chown of extra directories. Add chown option to do_tests.
Add populate options to docker_dev_start.
15.0.0
------
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/config.py
+
16
−
0
View file @
ef1ff605
...
...
@@ -11,6 +11,22 @@
SECTION
=
"
odoo_scripts
"
OTHER_SOURCES_KEY
=
"
other_sources
"
ODOO_7
=
"
odoo7
"
"""
Value for odoo_type representing Odoo 7.0
"""
ODOO_8
=
"
odoo8
"
"""
Value for odoo_type representing Odoo 8.0
"""
ODOO_9
=
"
odoo9
"
"""
.. warning: This version is not handled
"""
ODOO_10
=
"
odoo10
"
"""
Value for odoo_type representing Odoo 10.0
"""
ODOO_11
=
"
odoo11
"
"""
Value for odoo_type representing Odoo 11.0
"""
ODOO_12
=
"
odoo12
"
"""
.. warning: This version is not handled
"""
ODOO_13
=
"
odoo13
"
"""
Value for odoo_type representing Odoo 13.0
"""
ODOO_14
=
"
odoo14
"
"""
.. warning: This version is not handled
"""
ODOO_15
=
"
odoo15
"
"""
Value for odoo_type representing Odoo 15.0
"""
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/docker_dev_start.py
+
53
−
10
View file @
ef1ff605
...
...
@@ -15,7 +15,17 @@
from
docker.types
import
Mount
from
psycopg2
import
OperationalError
,
connect
from
.config
import
ODOO_15
,
Config
from
.config
import
(
ODOO_7
,
ODOO_8
,
ODOO_9
,
ODOO_10
,
ODOO_11
,
ODOO_12
,
ODOO_13
,
ODOO_15
,
Config
,
)
from
.docker_build
import
add_build_options
,
build_local_image
,
get_build_options
from
.docker_client
import
DockerClient
,
modules_mount
from
.docker_flake8
import
apply_flake8
,
parser_add_flake8_group
...
...
@@ -127,6 +137,17 @@
"
cannot be used at the same time
"
,
action
=
"
store_true
"
,
)
populate
=
group
.
add_argument_group
()
populate
.
add_argument
(
"
--populate-model
"
,
help
=
"
Populate the indicated model
"
,
default
=
None
,
)
populate
.
add_argument
(
"
--populate-size
"
,
help
=
"
Populate size
"
,
default
=
None
,
)
parser
.
add_argument
(
"
-i
"
,
"
--install
"
,
...
...
@@ -301,6 +322,8 @@
odoo_sources
=
nmspc
.
odoo_sources
pre_sql_script
=
nmspc
.
PRE_SQL
run_chown
=
nmspc
.
run_chown
populate_model
=
nmspc
.
populate_model
populate_size
=
nmspc
.
populate_size
if
restore_filename
:
if
not
database
:
...
...
@@ -353,7 +376,11 @@
"
odoo13
"
,
ODOO_15
,
)
arg
=
[
"
coverage-start
"
if
coverage
else
"
start
"
]
arg
=
[
"
populate
"
if
populate_model
or
populate_size
else
(
"
coverage-start
"
if
coverage
else
"
start
"
)
]
if
db_password
:
arg
.
append
(
"
--db_password %s
"
%
db_password
)
if
nmspc
.
update
:
...
...
@@ -406,6 +433,22 @@
if
load_language
and
installing_or_updating
:
arg
.
append
(
"
--load-language
"
)
arg
.
append
(
load_language
)
if
(
populate_model
or
populate_size
)
and
odoo_type
in
(
ODOO_7
,
ODOO_8
,
ODOO_9
,
ODOO_10
,
ODOO_11
,
ODOO_12
,
ODOO_13
,
):
_logger
.
warning
(
"
Populate is not available in your version
"
)
if
populate_model
:
arg
.
append
(
"
--model
"
)
arg
.
append
(
populate_model
)
if
populate_size
:
arg
.
append
(
"
--size
"
)
arg
.
append
(
populate_size
)
# auto detect local ip
if
use_host_network
:
...
...
@@ -448,7 +491,7 @@
_logger
.
info
(
"
Local configuration file found: %s
"
,
local_conf_path
)
odoo_conf_file
=
(
"
/etc/odoo/odoo.conf
"
if
odoo_type
in
(
"
odoo
11
"
,
"
odoo
12
"
,
"
odoo
13
"
,
ODOO_15
)
if
odoo_type
in
(
ODOO_
11
,
ODOO_
12
,
ODOO_
13
,
ODOO_15
)
else
"
/opt/odoo/etc/odoo.conf
"
)
mounts
.
append
(
...
...
@@ -759,7 +802,7 @@
# developer mode options
if
dev
:
if
odoo_type
in
(
"
odoo
10
"
,
"
odoo
11
"
,
"
odoo
13
"
,
ODOO_15
):
if
odoo_type
in
(
ODOO_
10
,
ODOO_
11
,
ODOO_
13
,
ODOO_15
):
# automatically add reload if not already asks for
if
not
any
(
opt
in
dev_opts
for
opt
in
(
"
all
"
,
"
reload
"
)):
dev_opts
.
append
(
"
reload
"
)
...
...
@@ -782,6 +825,6 @@
# bind Odoo sources
if
odoo_sources
:
_logger
.
info
(
"
Binding Odoo sources at %s
"
,
odoo_sources
)
if
odoo_type
in
(
"
odoo
10
"
,
"
odoo
11
"
,
"
odoo
13
"
,
ODOO_15
):
if
odoo_type
in
(
ODOO_
10
,
ODOO_
11
,
ODOO_
13
,
ODOO_15
):
# Image 11 uses python 3.5 if based on xenial, or 3.6 for bionic
# 13 uses bionic
...
...
@@ -786,4 +829,4 @@
# Image 11 uses python 3.5 if based on xenial, or 3.6 for bionic
# 13 uses bionic
if
odoo_type
==
"
odoo
10
"
:
if
odoo_type
==
ODOO_
10
:
pythons
=
(
"
python2.7
"
,)
...
...
@@ -789,3 +832,3 @@
pythons
=
(
"
python2.7
"
,)
elif
odoo_type
==
"
odoo
11
"
:
elif
odoo_type
==
ODOO_
11
:
pythons
=
(
"
python3.5
"
,
"
python3.6
"
)
...
...
@@ -791,6 +834,6 @@
pythons
=
(
"
python3.5
"
,
"
python3.6
"
)
elif
odoo_type
==
"
odoo
13
"
:
elif
odoo_type
==
ODOO_
13
:
pythons
=
(
"
python3.8
"
,)
elif
odoo_type
==
ODOO_15
:
pythons
=
(
"
python3.9
"
,)
else
:
...
...
@@ -793,8 +836,8 @@
pythons
=
(
"
python3.8
"
,)
elif
odoo_type
==
ODOO_15
:
pythons
=
(
"
python3.9
"
,)
else
:
pythons
=
(
"
python3.
6
"
,)
pythons
=
(
"
python3.
9
"
,)
for
python
in
pythons
:
mounts
.
append
(
Mount
(
...
...
@@ -817,7 +860,7 @@
"
bind
"
,
)
)
elif
odoo_type
in
(
"
odoo7
"
,
"
odoo8
"
):
elif
odoo_type
in
(
ODOO_7
,
ODOO_8
):
mounts
.
append
(
Mount
(
"
/opt/odoo/sources/odoo
"
,
odoo_sources
,
"
bind
"
))
else
:
raise
Exception
(
"
Unexpected odoo_type when binding sources: %s
"
%
odoo_type
)
...
...
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