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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
preetwinder
erp5
Commits
d8c7e3f9
Commit
d8c7e3f9
authored
Dec 16, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lazy_class use _getOb instead getattr, remove unnecessary commentaries.
parent
70ad0fcb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3860 additions
and
3891 deletions
+3860
-3891
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+3639
-3658
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+0
-4
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+3
-10
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+218
-219
No files found.
product/ERP5Type/Base.py
View file @
d8c7e3f9
This diff is collapsed.
Click to expand it.
product/ERP5Type/ERP5Type.py
View file @
d8c7e3f9
...
@@ -418,14 +418,10 @@ class ERP5TypeInformation(XMLObject,
...
@@ -418,14 +418,10 @@ class ERP5TypeInformation(XMLObject,
for
workflow
in
workflow_tool
.
getWorkflowsFor
(
ob
):
for
workflow
in
workflow_tool
.
getWorkflowsFor
(
ob
):
workflow
.
notifyCreated
(
ob
)
workflow
.
notifyCreated
(
ob
)
# =========== Project ERP5Workflow , WENJIE , 2014 ================================
### workflow_list need to be defined somewhere.
### exp: ERP5Workflow in Person module won't work at this situation.
for
ERP5Workflow
in
self
.
getTypeWorkflowList
():
for
ERP5Workflow
in
self
.
getTypeWorkflowList
():
workflow_module
=
portal
.
getDefaultModule
(
portal_type
=
"Workflow"
)
workflow_module
=
portal
.
getDefaultModule
(
portal_type
=
"Workflow"
)
ERP5Workflow
=
workflow_module
.
_getOb
(
ERP5Workflow
)
ERP5Workflow
=
workflow_module
.
_getOb
(
ERP5Workflow
)
ERP5Workflow
.
initializeDocument
(
ob
)
ERP5Workflow
.
initializeDocument
(
ob
)
# =========== WF5 ==============================================================
if
not
temp_object
:
if
not
temp_object
:
init_script
=
self
.
getTypeInitScriptId
()
init_script
=
self
.
getTypeInitScriptId
()
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
d8c7e3f9
...
@@ -266,25 +266,18 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
...
@@ -266,25 +266,18 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
else
:
else
:
initializePortalTypeDynamicWorkflowMethods
(
cls
,
portal_workflow
)
initializePortalTypeDynamicWorkflowMethods
(
cls
,
portal_workflow
)
# ================== ERP5Workflow Project, Wenjie, Dec 2014 =======================
portal_type
=
site
.
getDefaultModule
(
portal_type
=
"portal_types"
)
portal_type
=
site
.
getDefaultModule
(
portal_type
=
"portal_types"
)
### try to get workflow_list from related types then initialize the class of types
pt
=
portal_type
.
_getOb
(
cls
.
__name__
,
None
)
pt
=
getattr
(
portal_type
,
cls
.
__name__
,
None
)
if
pt
is
not
None
:
if
pt
is
not
None
:
#pt = portal_type._getOb(cls.__name__)
workflow_list
=
getattr
(
pt
,
'workflow_list'
,
None
)
#raise NotImplemented (pt)
if
workflow_list
is
not
None
:
wf
=
getattr
(
pt
,
'workflow_list'
,
None
)
if
wf
is
not
None
:
### Get ERP5Workflow Module
portal_ERP5Workflow
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
portal_ERP5Workflow
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
if
portal_ERP5Workflow
is
None
:
if
portal_ERP5Workflow
is
None
:
LOG
(
"ERP5Type.Dynamic"
,
WARNING
,
LOG
(
"ERP5Type.Dynamic"
,
WARNING
,
"no ERP5Workflow methods for %s"
"no ERP5Workflow methods for %s"
%
cls
.
__name__
)
%
cls
.
__name__
)
else
:
else
:
### Generate Workflow Method
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_ERP5Workflow
)
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_ERP5Workflow
)
# ================== WF5 =======================================================
# portal type group methods, isNodeType, isResourceType...
# portal type group methods, isNodeType, isResourceType...
from
Products.ERP5Type.ERP5Type
import
ERP5TypeInformation
from
Products.ERP5Type.ERP5Type
import
ERP5TypeInformation
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
d8c7e3f9
This diff is collapsed.
Click to expand it.
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