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
Sebastien Robin
erp5
Commits
7cd6f656
Commit
7cd6f656
authored
Aug 10, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken object error on conversion of Interaction Workflow
dynamic_class_generation_interaction_workflow
parent
9198bf91
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
14 deletions
+18
-14
product/ERP5/Interaction.py
product/ERP5/Interaction.py
+3
-0
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+3
-3
product/ERP5Type/tests/testERP5Type.py
product/ERP5Type/tests/testERP5Type.py
+6
-6
product/ERP5Workflow/Document/Interaction.py
product/ERP5Workflow/Document/Interaction.py
+1
-1
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+5
-4
No files found.
product/ERP5/Interaction.py
View file @
7cd6f656
...
...
@@ -109,6 +109,9 @@ class InteractionDefinition (SimpleItem):
def
getTriggerMethodIdList
(
self
):
return
self
.
method_id
def
getTriggerOncePerTransaction
(
self
):
return
self
.
once_per_transaction
_properties_form
=
DTMLFile
(
'interaction_properties'
,
_dtmldir
)
def
manage_properties
(
self
,
REQUEST
,
manage_tabs_message
=
None
):
...
...
product/ERP5Type/Base.py
View file @
7cd6f656
...
...
@@ -599,7 +599,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
interaction_queue
.
append
((
wf_id
,
tr_id
,
transition_id_set
,
tdef
.
once_per_transaction
,
tdef
.
getTriggerOncePerTransaction
()
,
method_id_matcher
))
# XXX - class stuff is missing here
...
...
@@ -618,7 +618,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
ptype_klass
.
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
method_id
)
ptype_klass
.
registerWorkflowMethod
(
method_id
,
wf_id
,
tr_id
,
tdef
.
once_per_transaction
)
tdef
.
getTriggerOncePerTransaction
()
)
continue
# Wrap method
...
...
@@ -641,7 +641,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
transition_id
=
method
.
getTransitionId
()
if
transition_id
in
transition_id_set
:
method
.
registerTransitionAlways
(
portal_type
,
wf_id
,
transition_id
)
if
tdef
.
once_per_transaction
:
if
tdef
.
getTriggerOncePerTransaction
()
:
method
.
registerTransitionOncePerTransaction
(
portal_type
,
wf_id
,
tr_id
)
else
:
method
.
registerTransitionAlways
(
portal_type
,
wf_id
,
tr_id
)
...
...
product/ERP5Type/tests/testERP5Type.py
View file @
7cd6f656
...
...
@@ -1065,7 +1065,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
commit
()
self
.
assertEqual
(
1
,
len
([
m
for
m
in
self
.
portal
.
portal_activities
.
getMessageList
()
if
m
.
method_id
==
'immediateReindexObject'
if
m
.
getTriggerMethodIdList
()
==
(
'immediateReindexObject'
,)
and
m
.
object_path
==
default_organisation
.
getPhysicalPath
()]))
self
.
tic
()
...
...
@@ -1079,7 +1079,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
commit
()
self
.
assertEqual
(
1
,
len
([
m
for
m
in
self
.
portal
.
portal_activities
.
getMessageList
()
if
m
.
method_id
==
'immediateReindexObject'
if
m
.
getTriggerMethodIdList
()
==
(
'immediateReindexObject'
,)
and
m
.
object_path
==
default_organisation
.
getPhysicalPath
()]))
self
.
tic
()
...
...
@@ -1095,7 +1095,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
commit
()
self
.
assertEqual
(
1
,
len
([
m
for
m
in
self
.
portal
.
portal_activities
.
getMessageList
()
if
m
.
method_id
==
'immediateReindexObject'
if
m
.
getTriggerMethodIdList
()
==
(
'immediateReindexObject'
,)
and
m
.
object_path
==
default_organisation
.
getPhysicalPath
()]))
self
.
tic
()
...
...
@@ -1126,7 +1126,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
commit
()
self
.
assertEqual
(
1
,
len
([
m
for
m
in
self
.
portal
.
portal_activities
.
getMessageList
()
if
m
.
method_id
==
'immediateReindexObject'
if
m
.
getTriggerMethodIdList
()
==
(
'immediateReindexObject'
,)
and
m
.
object_path
==
default_organisation
.
getPhysicalPath
()]))
self
.
tic
()
...
...
@@ -1140,7 +1140,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
commit
()
self
.
assertEqual
(
1
,
len
([
m
for
m
in
self
.
portal
.
portal_activities
.
getMessageList
()
if
m
.
method_id
==
'immediateReindexObject'
if
m
.
getTriggerMethodIdList
()
==
(
'immediateReindexObject'
,)
and
m
.
object_path
==
default_organisation
.
getPhysicalPath
()]))
self
.
tic
()
...
...
@@ -1156,7 +1156,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
commit
()
self
.
assertEqual
(
1
,
len
([
m
for
m
in
self
.
portal
.
portal_activities
.
getMessageList
()
if
m
.
method_id
==
'immediateReindexObject'
if
m
.
getTriggerMethodIdList
()
==
(
'immediateReindexObject'
,)
and
m
.
object_path
==
default_organisation
.
getPhysicalPath
()]))
self
.
tic
()
...
...
product/ERP5Workflow/Document/Interaction.py
View file @
7cd6f656
...
...
@@ -61,7 +61,7 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
trigger_type
=
TRIGGER_WORKFLOW_METHOD
portal_type_filter
=
None
portal_type_group_filter
=
None
once_per_transaction
=
False
trigger_
once_per_transaction
=
False
temporary_document_disallowed
=
False
var_exprs
=
None
# A mapping.
guard
=
None
...
...
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
7cd6f656
...
...
@@ -408,7 +408,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
interaction_prop_id_to_show
=
sorted
([
'actbox_category'
,
'actbox_url'
,
'actbox_name'
,
'activate_script_name'
,
'after_script_name'
,
'before_commit_script_name'
,
'description'
,
'groups'
,
'roles'
,
'expr'
,
'permissions'
,
'trigger_method_id'
,
'once_per_transaction'
,
'portal_type_filter'
,
'portal_type_group_filter'
,
'
trigger_
once_per_transaction'
,
'portal_type_filter'
,
'portal_type_group_filter'
,
'script_name'
,
'temporary_document_disallowed'
,
'trigger_type'
])
for
tdef
in
interaction_list
:
interaction_reference_list
.
append
(
tdef
.
getReference
())
...
...
@@ -437,13 +437,14 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
property_value
=
getattr
(
tdef
,
property_id
,
None
)
sub_object
=
SubElement
(
interaction
,
property_id
,
attrib
=
dict
(
type
=
'string'
))
elif
property_id
in
[
'activate_script_name'
,
'after_script_name'
,
'before_commit_script_name'
,
'portal_type_filter'
,
'portal_type_group_filter'
,
'script_name'
,
'before_commit_script_name'
,
'portal_type_filter'
,
'trigger_method_id'
,
'method_id'
,
'portal_type_group_filter'
,
'script_name'
,
'once_per_transaction'
,
'temporary_document_disallowed'
]:
if
property_id
==
'activate_script_name'
:
prop_id
=
'activate_script_name_list'
if
property_id
==
'after_script_name'
:
prop_id
=
'after_script_name_list'
if
property_id
==
'before_commit_script_name'
:
prop_id
=
'before_commit_script_name_list'
if
property_id
==
'trigger_method_id'
:
prop_id
=
'trigger_method_id_list'
if
property_id
in
(
'method_id'
,
'trigger_method_id'
):
prop_id
=
'trigger_method_id_list'
if
property_id
==
'once_per_transaction'
:
prop_id
=
'trigger_once_per_transaction'
if
property_id
==
'portal_type_filter'
:
prop_id
=
'portal_type_filter_list'
if
property_id
==
'portal_type_group_filter'
:
prop_id
=
'portal_type_group_filter_list'
if
property_id
==
'script_name'
:
prop_id
=
'before_script_name_list'
...
...
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