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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
603c8600
Commit
603c8600
authored
Dec 10, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow Method Generation for live test.
parent
425949fe
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
158 additions
and
63 deletions
+158
-63
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+133
-58
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+5
-4
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+20
-1
No files found.
product/ERP5Type/Base.py
View file @
603c8600
This diff is collapsed.
Click to expand it.
product/ERP5Type/ERP5Type.py
View file @
603c8600
...
...
@@ -46,6 +46,7 @@ from TranslationProviderBase import TranslationProviderBase
from
sys
import
exc_info
from
zLOG
import
LOG
,
ERROR
from
Products.CMFCore.exceptions
import
zExceptions_Unauthorized
from
types
import
NoneType
def
getCurrentUserIdOrAnonymousToken
():
"""Return connected user_id or simple token for
...
...
@@ -421,10 +422,9 @@ class ERP5TypeInformation(XMLObject,
for
workflow5
in
self
.
getTypeWorkflowList
():
workflow_module
=
portal
.
getDefaultModule
(
portal_type
=
"Workflow"
)
if
workflow_module
is
not
None
:
workflow5
=
workflow_module
.
_getOb
(
workflow5
)
workflow5
.
initializeDocument
(
ob
)
workflow5
=
workflow_module
.
_getOb
(
workflow5
)
workflow5
.
initializeDocument
(
ob
)
if
not
temp_object
:
init_script
=
self
.
getTypeInitScriptId
()
...
...
@@ -531,6 +531,7 @@ class ERP5TypeInformation(XMLObject,
"""
Return all the properties of the Portal Type
"""
### cls's class is PortalTypeMetaClass defined in ERP5Type/dynamic/lazy_class.py
cls
=
self
.
getPortalObject
().
portal_types
.
getPortalTypeClass
(
self
.
getId
())
return_set
=
set
()
for
property_dict
in
cls
.
getAccessorHolderPropertyList
(
content
=
True
):
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
603c8600
...
...
@@ -7,7 +7,7 @@ from Products.ERP5Type.Accessor.Constant import Getter as ConstantGetter
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Base
import
Base
as
ERP5Base
from
.
import
aq_method_lock
from
Products.ERP5Type.Base
import
PropertyHolder
,
initializePortalTypeDynamicWorkflowMethods
from
Products.ERP5Type.Base
import
PropertyHolder
,
initializePortalTypeDynamicWorkflowMethods
,
intializePortalTypeERP5WorkflowMethod
from
Products.ERP5Type.Utils
import
UpperCase
from
Products.ERP5Type.Core.CategoryProperty
import
CategoryProperty
from
ExtensionClass
import
ExtensionClass
,
pmc_init_of
...
...
@@ -266,6 +266,25 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
else
:
initializePortalTypeDynamicWorkflowMethods
(
cls
,
portal_workflow
)
# ================== Workflow5 Project, Wenjie, Dec 2014 =======================
#raise NotImplementedError (cls.__name__) # Category Property
### the ERP5Workflow list is defined in ERP5Type, only try to get erp5workflow
### when it's an erp5workflow related type.
if
cls
.
__name__
==
"Object Type"
:
portal_workflow5
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
#raise NotImplementedError (portal_workflow5) #<Workflow Module at workflow_module>
#raise NotImplementedError (cls.__module__) #<class 'erp5.portal_type.Category Property'>
if
portal_workflow5
is
None
:
LOG
(
"ERP5Type.Dynamic"
,
WARNING
,
"no workflow5 methods for %s"
%
cls
.
__name__
)
else
:
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_workflow5
)
# ================== WF5 =======================================================
# portal type group methods, isNodeType, isResourceType...
from
Products.ERP5Type.ERP5Type
import
ERP5TypeInformation
# XXX possible optimization:
...
...
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