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
!55
Improve chown
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Improve chown
topic/default/improve-chown
into
branch/default
Overview
0
Commits
5
Pipelines
0
Changes
1
Merged
Vincent Hatakeyama
requested to merge
topic/default/improve-chown
into
branch/default
3 years ago
Overview
0
Commits
5
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
f9e20d92
Prev
Next
Show latest version
1 file
+
12
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
f9e20d92
add extra flag --dev-opt in order to provide extra dev options
· f9e20d92
steeve.chailloux
authored
3 years ago
odoo_scripts/docker_dev_start.py
+
28
−
12
Options
@@ -229,10 +229,11 @@ USAGE
"
--no-dev
"
,
help
=
"
No dev options
"
,
action
=
"
store_false
"
,
dest
=
"
dev
"
)
dev_option_group
.
add_argument
(
"
--ipdb
"
,
help
=
"
Use ipdb rather than pdb
"
,
action
=
"
store_true
"
,
dest
=
"
ipdb
"
,
"
--dev-opt
"
,
help
=
"
add extra dev options
"
,
nargs
=
"
+
"
,
dest
=
"
dev_opts
"
,
default
=
[],
)
parser
.
add_argument
(
"
--load-language
"
,
@@ -320,7 +321,7 @@ USAGE
run_isort
=
nmspc
.
isort
odoo_help
=
nmspc
.
odoo_help
dev
=
nmspc
.
dev
ipdb
=
nmspc
.
ipdb
dev_opts
=
nmspc
.
dev_opts
restore_filename
=
nmspc
.
DUMP
database
=
nmspc
.
database
load_language
=
""
@@ -564,10 +565,15 @@ USAGE
# make sure the permission in the volumes are correct
if
run_chown
:
_logger
.
info
(
"
chown container’s /mnt to Odoo user
"
)
chown_directories
=
[
"
/mnt
"
]
if
odoo_type
not
in
(
"
odoo7
"
,
"
odoo8
"
):
chown_directories
.
append
(
"
/var/lib/odoo
"
)
_logger
.
info
(
"
chown container’s %s to Odoo user
"
,
"
,
"
.
join
(
chown_directories
)
)
client
.
containers
.
run
(
image
,
command
=
[
"
odoo
"
,
"
--recursive
"
,
"
/mnt
"
]
,
command
=
[
"
odoo
"
,
"
--recursive
"
]
+
chown_directories
,
remove
=
True
,
entrypoint
=
"
/bin/chown
"
,
mounts
=
mounts
,
@@ -789,15 +795,25 @@ USAGE
if
run_isort
:
isort
()
# developer mode options
if
dev
:
if
odoo_type
in
(
"
odoo10
"
,
"
odoo11
"
,
"
odoo13
"
):
# pdb should not be run if not interactive
if
ipdb
:
arg
.
append
(
"
--dev=reload,ipdb
"
)
else
:
arg
.
append
(
"
--dev=reload,pdb
"
)
# automatically add reload if not already asks for
if
not
any
(
opt
not
in
dev_opts
for
opt
in
(
"
all
"
,
"
reload
"
)):
dev_opts
.
append
(
"
reload
"
)
# XXX pdb should not be run if not interactive
# add pdb if no pubd, wdb, ipdb, pdb or all
# the list of available options differs by odoo version and can be
# seen with odoo --help, available with --odoo-help
if
not
any
(
debugger
not
in
dev_opts
for
debugger
in
(
"
pubd
"
,
"
wdb
"
,
"
ipdb
"
,
"
pdb
"
,
"
all
"
)
):
dev_opts
.
append
(
"
pdb
"
)
arg
.
append
(
f
"
--dev=
{
'
,
'
.
join
(
set
(
dev_opts
))
}
"
)
if
odoo_type
in
(
"
odoo8
"
,):
arg
.
append
(
"
--auto-reload
"
)
if
odoo_help
:
arg
.
append
(
"
--help
"
)
Loading