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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
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
seen_module_set
=
set
()
# 'Module Component': Only handle Product top-level modules
for
name
,
obj
in
inspect
.
getmembers
(
product_obj
):
if
(
name
[
0
]
==
'_'
or
name
in
(
'this_module'
,
'Permissions'
)
or
obj
is
product_obj
or
# Base cannot be migrated (InitGhostBase)
(
product_name
==
'ERP5Type'
and
name
==
'Base'
)):
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
:
for
submodule_filepath
in
glob
.
iglob
(
product_obj
.
__path__
[
0
]
+
'/*.py'
):
submodule_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
submodule_filepath
))[
0
]
source_reference
=
"%s.%s"
%
(
product_obj
.
__name__
,
submodule_name
)
if
(
submodule_name
not
in
(
'__init__'
,
'Permissions'
)
and
source_reference
not
in
seen_module_set
):
seen_module_set
.
add
(
source_reference
)
migrate
=
submodule_filepath
in
portal_type_module_filepath_set
obj
=
__newTempComponent
(
portal_type
=
'Module Component'
,
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