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
8be72e2a
Commit
8be72e2a
authored
4 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
Fix reading odoo_type when using expansion.
parent
ef395bd8
No related branches found
No related tags found
1 merge request
!24
Fix odoo type expanded
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+2
-0
2 additions, 0 deletions
NEWS.rst
odoo_scripts/config.py
+20
-9
20 additions, 9 deletions
odoo_scripts/config.py
with
22 additions
and
9 deletions
NEWS.rst
+
2
−
0
View file @
8be72e2a
...
...
@@ -13,6 +13,8 @@
Fix reading configuration value in python 2.7.
Fix reading odoo_type when using expansion.
7.0.3
-----
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/config.py
+
20
−
9
View file @
8be72e2a
...
...
@@ -64,7 +64,9 @@
if
blacklist
and
re
.
match
(
blacklist
,
value
[
"
path
"
]):
_logger
.
info
(
"
Ignoring directory
'
%s
'
due to blacklisting
"
,
value
[
"
path
"
],
os
.
path
.
join
(
path
,
value
[
"
path
"
])
if
path
else
value
[
"
path
"
],
)
else
:
if
path
:
...
...
@@ -125,9 +127,7 @@
for
key
in
(
"
db_user
"
,
"
db_password
"
,
"
load-language
"
):
setattr
(
self
,
key_format
(
key
),
section
.
get
(
key
,
None
))
def
read_expanded
(
key
:
str
,
default_value
=
None
,
always_set
:
bool
=
False
):
def
read_expanded
(
key
:
str
,
default_value
=
None
):
"""
Read from local version, or from expanded if value is found.
Raise an exception if more than one value is found.
"""
value
=
default_value
...
...
@@ -155,9 +155,9 @@
"
with different values
"
%
key
)
value
=
local_value
if
toread
(
key
)
or
always_set
:
if
toread
(
key
):
setattr
(
self
,
key
,
value
)
self
.
registry
=
section
.
get
(
"
registry
"
,
"
registry.xcg.io
"
)
project_path
=
os
.
path
.
realpath
(
"
.
"
)
self
.
image
=
section
.
get
(
"
image
"
,
os
.
path
.
basename
(
project_path
))
...
...
@@ -159,13 +159,18 @@
setattr
(
self
,
key
,
value
)
self
.
registry
=
section
.
get
(
"
registry
"
,
"
registry.xcg.io
"
)
project_path
=
os
.
path
.
realpath
(
"
.
"
)
self
.
image
=
section
.
get
(
"
image
"
,
os
.
path
.
basename
(
project_path
))
read_expanded
(
"
odoo_type
"
,
"
odoo7
"
,
always_set
=
True
)
if
self
.
odoo_type
not
in
(
read_expanded
(
"
odoo_type
"
,
"
odoo7
"
)
if
not
hasattr
(
self
,
"
odoo_type
"
):
# if path is set, odoo_type might not be in the values to read
# so no message
if
not
path
:
_logger
.
warning
(
"
Missing odoo_type
"
)
elif
self
.
odoo_type
not
in
(
"
odoo7
"
,
"
odoo8
"
,
"
odoo10
"
,
"
odoo11
"
,
"
odoo13
"
,
):
...
...
@@ -166,11 +171,17 @@
"
odoo7
"
,
"
odoo8
"
,
"
odoo10
"
,
"
odoo11
"
,
"
odoo13
"
,
):
_logger
.
warning
(
"
Unexpected odoo_type: %s
"
,
self
.
odoo_type
)
read_expanded
(
"
postgresql_version
"
,
"
9.6
"
)
if
path
:
_logger
.
info
(
"
Unexpected odoo_type: %s in %s
"
,
(
self
.
odoo_type
,
self
.
path
),
)
else
:
_logger
.
warning
(
"
Unexpected odoo_type: %s
"
,
self
.
odoo_type
)
read_expanded
(
"
postgresql_version
"
,
"
9.6
"
)
self
.
start_py3o
=
section
.
get
(
"
start_py3o
"
,
"
no
"
)
in
(
"
yes
"
,
"
true
"
)
...
...
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