Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
bd77552f
Commit
bd77552f
authored
Apr 28, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: Migration dialog: Modules not explicitly imported were not displayed.
parent
02945a1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
34 deletions
+6
-34
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+6
-34
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
bd77552f
...
@@ -6547,40 +6547,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
...
@@ -6547,40 +6547,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
seen_module_set
=
set
()
seen_module_set
=
set
()
# 'Module Component': Only handle Product top-level modules
# 'Module Component': Only handle Product top-level modules
for
name
,
obj
in
inspect
.
getmembers
(
product_obj
):
for
submodule_filepath
in
glob
.
iglob
(
product_obj
.
__path__
[
0
]
+
'/*.py'
):
if
(
name
[
0
]
==
'_'
or
submodule_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
submodule_filepath
))[
0
]
name
in
(
'this_module'
,
'Permissions'
)
or
source_reference
=
"%s.%s"
%
(
product_obj
.
__name__
,
submodule_name
)
obj
is
product_obj
or
if
(
submodule_name
not
in
(
'__init__'
,
'Permissions'
)
and
# Base cannot be migrated (InitGhostBase)
source_reference
not
in
seen_module_set
):
(
product_name
==
'ERP5Type'
and
name
==
'Base'
)):
seen_module_set
.
add
(
source_reference
)
continue
if
inspect
.
ismodule
(
obj
):
source_reference
=
obj
.
__name__
submodule_name
=
name
else
:
try
:
source_reference
=
obj
.
__module__
except
AttributeError
:
continue
try
:
submodule_name
=
source_reference
.
rsplit
(
'.'
,
1
)[
1
]
except
IndexError
:
continue
if
(
source_reference
==
product_obj
.
__name__
or
not
source_reference
.
startswith
(
product_obj
.
__name__
)
or
source_reference
in
seen_module_set
):
continue
seen_module_set
.
add
(
source_reference
)
try
:
submodule_filepath
=
inspect
.
getsourcefile
(
obj
)
except
TypeError
:
# No file, builtin?
continue
if
submodule_filepath
and
submodule_filepath
.
rsplit
(
'/'
,
1
)[
0
]
==
product_base_path
:
migrate
=
submodule_filepath
in
portal_type_module_filepath_set
migrate
=
submodule_filepath
in
portal_type_module_filepath_set
obj
=
__newTempComponent
(
portal_type
=
'Module Component'
,
obj
=
__newTempComponent
(
portal_type
=
'Module Component'
,
reference
=
submodule_name
,
reference
=
submodule_name
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment