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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
a0dfb228
Commit
a0dfb228
authored
Nov 08, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into zope4py2
parents
f1216db4
164e4631
Changes
26
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
498 additions
and
460 deletions
+498
-460
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_cache_interaction_workflow/script_Account_flushAccountListCacheIfAccountIsValidated.py
...ript_Account_flushAccountListCacheIfAccountIsValidated.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/script_validateTransactionLines.py
...ow/accounting_workflow/script_validateTransactionLines.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_guessGroupingReference.py
...tion_simulation_workflow/script_guessGroupingReference.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_initialiseMirrorAccountingAndSetReferences.py
...flow/script_initialiseMirrorAccountingAndSetReferences.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_resetGroupingReference.py
...tion_simulation_workflow/script_resetGroupingReference.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_setReferences.py
...e_transaction_simulation_workflow/script_setReferences.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_validateTransaction.py
...saction_simulation_workflow/script_validateTransaction.py
+1
-1
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_validateTransactionLines.py
...on_simulation_workflow/script_validateTransactionLines.py
+1
-1
bt5/erp5_apparel/DocumentTemplateItem/portal_components/document.erp5.ApparelMeasurement.py
...tem/portal_components/document.erp5.ApparelMeasurement.py
+2
-2
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/script_DeliveryMovement_unlinkSimulation.py
...tion_workflow/script_DeliveryMovement_unlinkSimulation.py
+1
-1
bt5/erp5_certificate_authority/TestTemplateItem/portal_components/test.erp5_certificate_authority.testCertificateAuthorityTool.py
...rp5_certificate_authority.testCertificateAuthorityTool.py
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBase.py
.../TestTemplateItem/portal_components/test.erp5.testBase.py
+26
-22
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
...eItem/portal_components/test.erp5.testBusinessTemplate.py
+10
-5
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testInteractionWorkflow.py
...em/portal_components/test.erp5.testInteractionWorkflow.py
+163
-150
bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/script_Event_checkConsistencyForAcknowledge.py
...t_workflow/script_Event_checkConsistencyForAcknowledge.py
+1
-1
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
...ort_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
+2
-2
bt5/erp5_test_result/WorkflowTemplateItem/portal_workflow/test_result_workflow/script_TestResult_fail.py
...l_workflow/test_result_workflow/script_TestResult_fail.py
+1
-1
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/ticket_record_interaction_workflow/script_Ticket_updateRecord.py
...record_interaction_workflow/script_Ticket_updateRecord.py
+3
-3
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+5
-1
product/ERP5Type/Tool/WorkflowTool.py
product/ERP5Type/Tool/WorkflowTool.py
+12
-6
product/ERP5Type/ZopePatch.py
product/ERP5Type/ZopePatch.py
+2
-4
product/ERP5Type/patches/StateChangeInfoPatch.py
product/ERP5Type/patches/StateChangeInfoPatch.py
+0
-1
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+250
-249
product/ERP5Type/tests/SecurityTestCase.py
product/ERP5Type/tests/SecurityTestCase.py
+0
-1
product/ERP5Type/tests/testERP5NamingConvention.py
product/ERP5Type/tests/testERP5NamingConvention.py
+3
-2
product/ERP5Type/tests/testUpgradeInstanceWithOldDataFs.py
product/ERP5Type/tests/testUpgradeInstanceWithOldDataFs.py
+8
-0
No files found.
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_cache_interaction_workflow/script_Account_flushAccountListCacheIfAccountIsValidated.py
View file @
a0dfb228
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
because only validated accounts are displayed in the cache.
because only validated accounts are displayed in the cache.
"""
"""
if
sci
[
'object'
].
getValidationState
()
==
'validated'
:
if
sci
[
'object'
].
getValidationState
()
==
'validated'
:
container
.
Account_flushAccountListCache
(
sci
)
container
.
script_
Account_flushAccountListCache
(
sci
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/script_validateTransactionLines.py
View file @
a0dfb228
...
@@ -13,7 +13,7 @@ section_portal_type_list = ['Person', 'Organisation']
...
@@ -13,7 +13,7 @@ section_portal_type_list = ['Person', 'Organisation']
invalid_state_list
=
[
'invalidated'
,
'deleted'
]
invalid_state_list
=
[
'invalidated'
,
'deleted'
]
# first of all, validate the transaction itself
# first of all, validate the transaction itself
container
.
validateTransaction
(
state_change
)
container
.
script_
validateTransaction
(
state_change
)
# Check that all lines uses open accounts, and doesn't use invalid third
# Check that all lines uses open accounts, and doesn't use invalid third
...
...
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_guessGroupingReference.py
View file @
a0dfb228
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()](
sci
)
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
[
script
.
getId
()](
sci
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_initialiseMirrorAccountingAndSetReferences.py
View file @
a0dfb228
state_change
[
'object'
].
AccountingTransaction_setDefaultMirrorAccountList
()
state_change
[
'object'
].
AccountingTransaction_setDefaultMirrorAccountList
()
return
container
.
setReferences
(
state_change
)
return
container
.
s
cript_s
etReferences
(
state_change
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_resetGroupingReference.py
View file @
a0dfb228
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()](
sci
)
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
[
script
.
getId
()](
sci
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_setReferences.py
View file @
a0dfb228
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()](
state_change
)
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
[
script
.
getId
()](
state_change
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_validateTransaction.py
View file @
a0dfb228
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()](
state_change
)
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
[
script
.
getId
()](
state_change
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_validateTransactionLines.py
View file @
a0dfb228
...
@@ -7,4 +7,4 @@ if old_state.getId() == 'draft':
...
@@ -7,4 +7,4 @@ if old_state.getId() == 'draft':
if
internal_invoice
.
InternalInvoiceTransaction_getAuthenticatedUserSection
()
==
internal_invoice
.
getDestinationSection
():
if
internal_invoice
.
InternalInvoiceTransaction_getAuthenticatedUserSection
()
==
internal_invoice
.
getDestinationSection
():
raise
ValidationFailed
(
translateString
(
"Your entity should not be destination."
))
raise
ValidationFailed
(
translateString
(
"Your entity should not be destination."
))
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()](
state_change
)
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
[
script
.
getId
()](
state_change
)
bt5/erp5_apparel/DocumentTemplateItem/portal_components/document.erp5.ApparelMeasurement.py
View file @
a0dfb228
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
##############################################################################
##############################################################################
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.
CMFCore.WorkflowCore
import
WorkflowAction
from
Products.
ERP5Type.Base
import
WorkflowMethod
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
...
@@ -64,7 +64,7 @@ class ApparelMeasurement(XMLObject, XMLMatrix, Image):
...
@@ -64,7 +64,7 @@ class ApparelMeasurement(XMLObject, XMLMatrix, Image):
# Inheritance
# Inheritance
_edit
=
Image
.
_edit
_edit
=
Image
.
_edit
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'edit'
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'edit'
)
edit
=
Workflow
Action
(
_edit
)
edit
=
Workflow
Method
(
_edit
)
security
.
declareProtected
(
Permissions
.
View
,
'index_html'
)
security
.
declareProtected
(
Permissions
.
View
,
'index_html'
)
index_html
=
Image
.
index_html
index_html
=
Image
.
index_html
...
...
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/script_DeliveryMovement_unlinkSimulation.py
View file @
a0dfb228
...
@@ -24,4 +24,4 @@ for simulation_movement in simulation_movement_list:
...
@@ -24,4 +24,4 @@ for simulation_movement in simulation_movement_list:
if
simulation_movement
.
getOrder
()
==
delivery_movement
.
getRelativeUrl
():
if
simulation_movement
.
getOrder
()
==
delivery_movement
.
getRelativeUrl
():
simulation_movement
.
setOrder
(
None
)
simulation_movement
.
setOrder
(
None
)
cont
ext
.
DeliveryMovement_updateSimulation
(
state_change
)
cont
ainer
.
script_
DeliveryMovement_updateSimulation
(
state_change
)
bt5/erp5_certificate_authority/TestTemplateItem/portal_components/test.erp5_certificate_authority.testCertificateAuthorityTool.py
View file @
a0dfb228
...
@@ -31,7 +31,7 @@ import os
...
@@ -31,7 +31,7 @@ import os
import
random
import
random
import
unittest
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.
DCWorkflow.DC
Workflow
import
ValidationFailed
from
Products.
ERP5Type.Core.
Workflow
import
ValidationFailed
from
AccessControl
import
Unauthorized
from
AccessControl
import
Unauthorized
class
TestCertificateAuthority
(
ERP5TypeTestCase
):
class
TestCertificateAuthority
(
ERP5TypeTestCase
):
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBase.py
View file @
a0dfb228
...
@@ -966,19 +966,23 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -966,19 +966,23 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
# Add a non-existent workflow.
# Add a non-existent workflow.
pw
=
self
.
getWorkflowTool
()
pw
=
self
.
getWorkflowTool
()
dummy_simulation_wor
l
flow_id
=
'fake_simulation_workflow'
dummy_simulation_wor
k
flow_id
=
'fake_simulation_workflow'
dummy_validation_wor
l
flow_id
=
'fake_validation_workflow'
dummy_validation_wor
k
flow_id
=
'fake_validation_workflow'
#Assume that erp5_styles workflow Manage permissions with acquired Role by default
#Assume that erp5_styles workflow Manage permissions with acquired Role by default
addWorkflowByType
(
pw
,
'erp5_workflow'
,
dummy_simulation_worlflow_id
)
dummy_simulation_workflow
=
pw
.
newContent
(
addWorkflowByType
(
pw
,
'erp5_workflow'
,
dummy_validation_worlflow_id
)
portal_type
=
'Workflow'
,
dummy_simulation_worlflow
=
pw
[
dummy_simulation_worlflow_id
]
reference
=
dummy_simulation_workflow_id
,
dummy_validation_worlflow
=
pw
[
dummy_validation_worlflow_id
]
)
dummy_validation_worlflow
.
variables
.
setStateVar
(
'validation_state'
)
dummy_validation_workflow
=
pw
.
newContent
(
portal_type
=
'Workflow'
,
reference
=
dummy_validation_workflow_id
,
state_variable
=
'validation_state'
,
)
organisation_type
=
portal
.
portal_types
.
getTypeInfo
(
portal_type
)
organisation_type
=
portal
.
portal_types
.
getTypeInfo
(
portal_type
)
organisation_initial_workflow_list
=
organisation_type
.
getTypeWorkflowList
()
organisation_initial_workflow_list
=
organisation_type
.
getTypeWorkflowList
()
organisation_type
.
setTypeWorkflowList
([
dummy_validation_wor
l
flow_id
,
organisation_type
.
setTypeWorkflowList
([
dummy_validation_wor
k
flow_id
,
dummy_simulation_wor
l
flow_id
])
dummy_simulation_wor
k
flow_id
])
permission_list
=
list
(
dummy_simulation_worlflow
.
permissions
)
permission_list
=
dummy_simulation_workflow
.
getWorkflowManagedPermissionList
(
)
manager_has_permission
=
{}
manager_has_permission
=
{}
for
permission
in
permission_list
:
for
permission
in
permission_list
:
manager_has_permission
[
permission
]
=
(
'Manager'
,)
manager_has_permission
[
permission
]
=
(
'Manager'
,)
...
@@ -989,7 +993,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -989,7 +993,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
user
=
getSecurityManager
().
getUser
()
user
=
getSecurityManager
().
getUser
()
try
:
try
:
self
.
assertTrue
(
permission_list
)
self
.
assertTrue
(
permission_list
)
self
.
assertFalse
(
dummy_simulation_wor
lflow
.
states
.
draft
.
permission_roles
)
self
.
assertFalse
(
dummy_simulation_wor
kflow
[
'state_draft'
].
getStatePermissionRoleListDict
()
)
#1
#1
obj
=
module
.
newContent
(
portal_type
=
portal_type
)
obj
=
module
.
newContent
(
portal_type
=
portal_type
)
#No role is defined by default on workflow
#No role is defined by default on workflow
...
@@ -999,28 +1003,28 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -999,28 +1003,28 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
for
permission
in
permission_list
:
for
permission
in
permission_list
:
self
.
assertTrue
(
user
.
has_permission
(
permission
,
obj
))
self
.
assertTrue
(
user
.
has_permission
(
permission
,
obj
))
#2 Now configure both workflow with same configuration
#2 Now configure both workflow with same configuration
dummy_simulation_wor
lflow
.
states
.
draft
.
permission_roles
=
manager_has_permission
.
copy
(
)
dummy_simulation_wor
kflow
[
'state_draft'
].
setStatePermissionRoleListDict
(
manager_has_permission
.
copy
()
)
dummy_validation_wor
lflow
.
states
.
draft
.
permission_roles
=
manager_has_permission
.
copy
(
)
dummy_validation_wor
kflow
[
'state_draft'
].
setStatePermissionRoleListDict
(
manager_has_permission
.
copy
()
)
dummy_simulation_wor
l
flow
.
updateRoleMappingsFor
(
obj
)
dummy_simulation_wor
k
flow
.
updateRoleMappingsFor
(
obj
)
dummy_validation_wor
l
flow
.
updateRoleMappingsFor
(
obj
)
dummy_validation_wor
k
flow
.
updateRoleMappingsFor
(
obj
)
for
permission
in
permission_list
:
for
permission
in
permission_list
:
self
.
assertTrue
(
user
.
has_permission
(
permission
,
obj
))
self
.
assertTrue
(
user
.
has_permission
(
permission
,
obj
))
#3 change only dummy_simulation_wor
l
flow
#3 change only dummy_simulation_wor
k
flow
dummy_simulation_wor
lflow
.
states
.
draft
.
permission_roles
=
manager_has_no_permission
.
copy
(
)
dummy_simulation_wor
kflow
[
'state_draft'
].
setStatePermissionRoleListDict
(
manager_has_no_permission
.
copy
()
)
dummy_simulation_wor
l
flow
.
updateRoleMappingsFor
(
obj
)
dummy_simulation_wor
k
flow
.
updateRoleMappingsFor
(
obj
)
for
permission
in
permission_list
:
for
permission
in
permission_list
:
self
.
assertFalse
(
user
.
has_permission
(
permission
,
obj
))
self
.
assertFalse
(
user
.
has_permission
(
permission
,
obj
))
#4 enable acquisition for dummy_simulation_wor
l
flow
#4 enable acquisition for dummy_simulation_wor
k
flow
dummy_simulation_wor
lflow
.
states
.
draft
.
permission_roles
=
None
dummy_simulation_wor
kflow
[
'state_draft'
].
setAcquirePermissionList
(
permission_list
)
dummy_simulation_wor
l
flow
.
updateRoleMappingsFor
(
obj
)
dummy_simulation_wor
k
flow
.
updateRoleMappingsFor
(
obj
)
for
permission
in
permission_list
:
for
permission
in
permission_list
:
self
.
assertTrue
(
user
.
has_permission
(
permission
,
obj
))
self
.
assertTrue
(
user
.
has_permission
(
permission
,
obj
))
finally
:
finally
:
# Make sure that the artificial workflow is not referred to any longer.
# Make sure that the artificial workflow is not referred to any longer.
organisation_type
.
setTypeWorkflowList
(
organisation_initial_workflow_list
)
organisation_type
.
setTypeWorkflowList
(
organisation_initial_workflow_list
)
pw
.
manage_delObjects
([
dummy_simulation_wor
lflow_id
,
dummy_validation_worl
flow_id
])
pw
.
manage_delObjects
([
dummy_simulation_wor
kflow_id
,
dummy_validation_work
flow_id
])
def
test_getViewPermissionOwnerDefault
(
self
):
def
test_getViewPermissionOwnerDefault
(
self
):
"""Test getViewPermissionOwner method behaviour"""
"""Test getViewPermissionOwner method behaviour"""
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
View file @
a0dfb228
...
@@ -39,7 +39,6 @@ from urllib import pathname2url
...
@@ -39,7 +39,6 @@ from urllib import pathname2url
from
Products.ERP5Type.Globals
import
PersistentMapping
from
Products.ERP5Type.Globals
import
PersistentMapping
from
Products.ERP5Type.dynamic.lazy_class
import
ERP5BaseBroken
from
Products.ERP5Type.dynamic.lazy_class
import
ERP5BaseBroken
from
Products.ERP5Type.tests.utils
import
LogInterceptor
from
Products.ERP5Type.tests.utils
import
LogInterceptor
from
Products.ERP5Type.Workflow
import
addWorkflowByType
import
shutil
import
shutil
import
os
import
os
import
random
import
random
...
@@ -1315,8 +1314,11 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -1315,8 +1314,11 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
"""
"""
wf_id
=
'geek_workflow'
wf_id
=
'geek_workflow'
pw
=
self
.
getWorkflowTool
()
pw
=
self
.
getWorkflowTool
()
addWorkflowByType
(
pw
,
WORKFLOW_TYPE
,
wf_id
)
workflow
=
pw
.
newContent
(
workflow
=
pw
.
_getOb
(
wf_id
,
None
)
portal_type
=
'Workflow'
,
reference
=
wf_id
,
)
self
.
tic
()
self
.
assertTrue
(
workflow
is
not
None
)
self
.
assertTrue
(
workflow
is
not
None
)
sequence
.
edit
(
workflow_id
=
workflow
.
getId
())
sequence
.
edit
(
workflow_id
=
workflow
.
getId
())
...
@@ -2886,8 +2888,11 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -2886,8 +2888,11 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
"""
"""
wf_id
=
'custom_geek_workflow'
wf_id
=
'custom_geek_workflow'
pw
=
self
.
getWorkflowTool
()
pw
=
self
.
getWorkflowTool
()
addWorkflowByType
(
pw
,
WORKFLOW_TYPE
,
wf_id
)
workflow
=
pw
.
newContent
(
workflow
=
pw
.
_getOb
(
wf_id
,
None
)
portal_type
=
'Workflow'
,
reference
=
wf_id
,
)
self
.
tic
()
self
.
assertTrue
(
workflow
is
not
None
)
self
.
assertTrue
(
workflow
is
not
None
)
sequence
.
edit
(
workflow_id
=
workflow
.
getId
())
sequence
.
edit
(
workflow_id
=
workflow
.
getId
())
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testInteractionWorkflow.py
View file @
a0dfb228
This diff is collapsed.
Click to expand it.
bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/script_Event_checkConsistencyForAcknowledge.py
View file @
a0dfb228
from
Products.ERP5Type.Core.Workflow
import
ValidationFailed
from
Products.ERP5Type.Core.Workflow
import
ValidationFailed
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Message
import
translateString
container
.
Event_checkConsistency
(
sci
)
container
.
script_
Event_checkConsistency
(
sci
)
portal
=
sci
.
getPortal
()
portal
=
sci
.
getPortal
()
portal_workflow
=
portal
.
portal_workflow
portal_workflow
=
portal
.
portal_workflow
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
View file @
a0dfb228
...
@@ -10,9 +10,9 @@ portal = context.getPortalObject()
...
@@ -10,9 +10,9 @@ portal = context.getPortalObject()
query_dict
=
{}
query_dict
=
{}
workflow
=
portal
.
portal_workflow
.
ticket_workflow
workflow
=
portal
.
portal_workflow
.
ticket_workflow
workflow_state_var
=
workflow
.
variables
.
getStateVar
()
workflow_state_var
=
workflow
.
getStateVariable
()
for
worklist
in
workflow
.
worklists
.
objectValues
():
for
worklist
in
workflow
.
getWorklistValueList
():
identity_criterion_dict
=
worklist
.
getIdentityCriterionDict
()
identity_criterion_dict
=
worklist
.
getIdentityCriterionDict
()
if
portal_type
\
if
portal_type
\
and
'portal_type'
in
worklist
.
getCriterionPropertyList
()
\
and
'portal_type'
in
worklist
.
getCriterionPropertyList
()
\
...
...
bt5/erp5_test_result/WorkflowTemplateItem/portal_workflow/test_result_workflow/script_TestResult_fail.py
View file @
a0dfb228
...
@@ -15,4 +15,4 @@ if test_result.getPortalType() == 'Test Result Node':
...
@@ -15,4 +15,4 @@ if test_result.getPortalType() == 'Test Result Node':
edit_kw
[
key
]
=
key_value
edit_kw
[
key
]
=
key_value
test_result
.
edit
(
**
edit_kw
)
test_result
.
edit
(
**
edit_kw
)
else
:
else
:
cont
ext
.
TestResult_complete
(
sci
)
cont
ainer
.
script_
TestResult_complete
(
sci
)
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/ticket_record_interaction_workflow/script_Ticket_updateRecord.py
View file @
a0dfb228
...
@@ -3,14 +3,14 @@ portal = context.getPortalObject()
...
@@ -3,14 +3,14 @@ portal = context.getPortalObject()
portal_type
=
ticket
.
getPortalType
()
portal_type
=
ticket
.
getPortalType
()
if
portal_type
in
(
"Leave Request"
,
"Leave Request Period"
):
if
portal_type
in
(
"Leave Request"
,
"Leave Request Period"
):
cont
ext
.
Alarm_safeTrigger
(
cont
ainer
.
script_
Alarm_safeTrigger
(
portal
.
portal_alarms
.
create_representative_record_for_leave_request
portal
.
portal_alarms
.
create_representative_record_for_leave_request
)
)
elif
portal_type
in
(
"Expense Validation Request"
):
elif
portal_type
in
(
"Expense Validation Request"
):
cont
ext
.
Alarm_safeTrigger
(
cont
ainer
.
script_
Alarm_safeTrigger
(
portal
.
portal_alarms
.
create_representative_record_for_expense_validation_request
portal
.
portal_alarms
.
create_representative_record_for_expense_validation_request
)
)
elif
portal_type
in
(
"Travel Request"
):
elif
portal_type
in
(
"Travel Request"
):
cont
ext
.
Alarm_safeTrigger
(
cont
ainer
.
script_
Alarm_safeTrigger
(
portal
.
portal_alarms
.
create_representative_record_for_travel_request
portal
.
portal_alarms
.
create_representative_record_for_travel_request
)
)
product/ERP5Type/Base.py
View file @
a0dfb228
...
@@ -3534,7 +3534,11 @@ class Base(
...
@@ -3534,7 +3534,11 @@ class Base(
# Use meta transition to jump from one state to another
# Use meta transition to jump from one state to another
# without existing transitions.
# without existing transitions.
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
else
:
InteractionWorkflowDefinition
=
None
.
__class__
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
workflow_tool
=
portal
.
portal_workflow
workflow_tool
=
portal
.
portal_workflow
...
...
product/ERP5Type/Tool/WorkflowTool.py
View file @
a0dfb228
...
@@ -98,7 +98,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -98,7 +98,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
This is public method to allow passing meta transition (Jump form
This is public method to allow passing meta transition (Jump form
any state to another in same workflow)
any state to another in same workflow)
"""
"""
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
else
:
InteractionWorkflowDefinition
=
None
.
__class__
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
workflow_list
=
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())
workflow_list
=
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())
if
wf_id
is
None
:
if
wf_id
is
None
:
...
@@ -124,7 +127,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -124,7 +127,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
"""Test if given state_id is available for ob
"""Test if given state_id is available for ob
in at least one associated workflow
in at least one associated workflow
"""
"""
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
else
:
InteractionWorkflowDefinition
=
None
.
__class__
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())):
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())):
if
not
isinstance
(
workflow
,
(
InteractionWorkflowDefinition
,
if
not
isinstance
(
workflow
,
(
InteractionWorkflowDefinition
,
...
@@ -639,10 +645,10 @@ if WITH_LEGACY_WORKFLOW:
...
@@ -639,10 +645,10 @@ if WITH_LEGACY_WORKFLOW:
deprecated
(
'getWorkflowIds() is deprecated; use objectIds()'
)
\
deprecated
(
'getWorkflowIds() is deprecated; use objectIds()'
)
\
(
lambda
self
:
self
.
objectIds
())
(
lambda
self
:
self
.
objectIds
())
WorkflowTool
.
security
.
declarePrivate
(
'getWorkflowIds'
)
WorkflowTool
.
security
.
declarePrivate
(
'getWorkflowIds'
)
WorkflowTool
.
getWorkflowById
=
\
deprecated
(
'getWorkflowById() is deprecated'
)
\
# XXX We still use portal_workflow.getInfoFor, that calls WorkflowTool.getWorkflowById
(
lambda
self
,
wf_id
:
self
.
_getOb
(
wf_id
,
None
)
)
WorkflowTool
.
getWorkflowById
=
lambda
self
,
wf_id
:
self
.
_getOb
(
wf_id
,
None
)
WorkflowTool
.
security
.
declarePrivate
(
'getWorkflowById'
)
WorkflowTool
.
security
.
declarePrivate
(
'getWorkflowById'
)
InitializeClass
(
WorkflowTool
)
InitializeClass
(
WorkflowTool
)
...
...
product/ERP5Type/ZopePatch.py
View file @
a0dfb228
...
@@ -37,8 +37,7 @@ if WITH_LEGACY_WORKFLOW:
...
@@ -37,8 +37,7 @@ if WITH_LEGACY_WORKFLOW:
from
Products.ERP5Type.patches
import
DCWorkflow
from
Products.ERP5Type.patches
import
DCWorkflow
from
Products.ERP5Type.patches
import
Worklists
from
Products.ERP5Type.patches
import
Worklists
from
Products.ERP5Type.patches
import
BTreeFolder2
from
Products.ERP5Type.patches
import
BTreeFolder2
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5Type.patches
import
WorkflowTool
from
Products.ERP5Type.patches
import
WorkflowTool
from
Products.ERP5Type.patches
import
DynamicType
from
Products.ERP5Type.patches
import
DynamicType
from
Products.ERP5Type.patches
import
Expression
from
Products.ERP5Type.patches
import
Expression
from
Products.ERP5Type.patches
import
sqltest
from
Products.ERP5Type.patches
import
sqltest
...
@@ -63,8 +62,7 @@ from Products.ERP5Type.patches import DateTimePatch
...
@@ -63,8 +62,7 @@ from Products.ERP5Type.patches import DateTimePatch
from
Products.ERP5Type.patches
import
PythonScript
from
Products.ERP5Type.patches
import
PythonScript
from
Products.ERP5Type.patches
import
MailHost
from
Products.ERP5Type.patches
import
MailHost
from
Products.ERP5Type.patches
import
memcache_client
from
Products.ERP5Type.patches
import
memcache_client
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5Type.patches
import
StateChangeInfoPatch
from
Products.ERP5Type.patches
import
StateChangeInfoPatch
from
Products.ERP5Type.patches
import
transforms
from
Products.ERP5Type.patches
import
transforms
from
Products.ERP5Type.patches
import
OFSPdata
from
Products.ERP5Type.patches
import
OFSPdata
from
Products.ERP5Type.patches
import
DemoStorage
from
Products.ERP5Type.patches
import
DemoStorage
...
...
product/ERP5Type/patches/StateChangeInfoPatch.py
View file @
a0dfb228
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
##############################################################################
##############################################################################
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
assert
WITH_LEGACY_WORKFLOW
from
Products.DCWorkflow.Expression
import
StateChangeInfo
from
Products.DCWorkflow.Expression
import
StateChangeInfo
from
Products.PythonScripts.Utility
import
allow_class
from
Products.PythonScripts.Utility
import
allow_class
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
a0dfb228
...
@@ -13,41 +13,7 @@
...
@@ -13,41 +13,7 @@
#
#
##############################################################################
##############################################################################
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
assert
WITH_LEGACY_WORKFLOW
from
zLOG
import
LOG
,
WARNING
from
types
import
StringTypes
# Make sure Interaction Workflows are called even if method not wrapped
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.CMFCore.WorkflowTool
import
WorkflowTool
from
Products.CMFCore.WorkflowCore
import
ObjectDeleted
from
Products.CMFCore.WorkflowCore
import
WorkflowException
from
Products.DCWorkflow.DCWorkflow
import
DCWorkflowDefinition
from
Products.DCWorkflow.Transitions
import
TRIGGER_WORKFLOW_METHOD
from
Products.DCWorkflow.utils
import
Message
as
_
from
Products.DCWorkflow.Transitions
import
TRIGGER_USER_ACTION
from
Products.CMFCore.utils
import
getToolByName
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
,
AutoQuery
,
ComplexQuery
,
NegatedQuery
from
Products.CMFCore.utils
import
_getAuthenticatedUser
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Cache
import
CachingMethod
from
Products.ERP5Type.Workflow
import
WorkflowHistoryList
as
NewWorkflowHistoryList
from
Products.ERP5Type.Workflow
import
WorkflowHistoryList
as
NewWorkflowHistoryList
from
sets
import
ImmutableSet
from
Acquisition
import
aq_base
from
Products.ERP5Type.Globals
import
PersistentMapping
from
MySQLdb
import
ProgrammingError
,
OperationalError
from
DateTime
import
DateTime
security
=
ClassSecurityInfo
()
WorkflowTool
.
security
=
security
WORKLIST_METADATA_KEY
=
'metadata'
SECURITY_PARAMETER_ID
=
'local_roles'
class
WorkflowHistoryList
(
NewWorkflowHistoryList
):
class
WorkflowHistoryList
(
NewWorkflowHistoryList
):
...
@@ -105,21 +71,56 @@ class WorkflowHistoryList(NewWorkflowHistoryList):
...
@@ -105,21 +71,56 @@ class WorkflowHistoryList(NewWorkflowHistoryList):
# BBB: A production instance used a temporary patch to speed up.
# BBB: A production instance used a temporary patch to speed up.
WorkflowHistoryBucketList
=
WorkflowHistoryList
WorkflowHistoryBucketList
=
WorkflowHistoryList
def
WorkflowTool_getChainDict
(
self
):
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
if
WITH_LEGACY_WORKFLOW
:
import
six
from
zLOG
import
LOG
,
WARNING
from
types
import
StringTypes
# Make sure Interaction Workflows are called even if method not wrapped
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.CMFCore.WorkflowTool
import
WorkflowTool
from
Products.CMFCore.WorkflowCore
import
ObjectDeleted
from
Products.CMFCore.WorkflowCore
import
WorkflowException
from
Products.DCWorkflow.DCWorkflow
import
DCWorkflowDefinition
from
Products.DCWorkflow.Transitions
import
TRIGGER_WORKFLOW_METHOD
from
Products.DCWorkflow.utils
import
Message
as
_
from
Products.DCWorkflow.Transitions
import
TRIGGER_USER_ACTION
from
Products.CMFCore.utils
import
getToolByName
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
,
AutoQuery
,
ComplexQuery
,
NegatedQuery
from
Products.CMFCore.utils
import
_getAuthenticatedUser
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Cache
import
CachingMethod
from
sets
import
ImmutableSet
from
Acquisition
import
aq_base
from
Products.ERP5Type.Globals
import
PersistentMapping
from
MySQLdb
import
ProgrammingError
,
OperationalError
from
DateTime
import
DateTime
security
=
ClassSecurityInfo
()
WorkflowTool
.
security
=
security
WORKLIST_METADATA_KEY
=
'metadata'
SECURITY_PARAMETER_ID
=
'local_roles'
def
WorkflowTool_getChainDict
(
self
):
"""Test if the given transition exist from the current state.
"""Test if the given transition exist from the current state.
"""
"""
chain_dict
=
{}
chain_dict
=
{}
for
portal_type
,
wf_id_list
in
self
.
_chains_by_type
.
iteritems
(
):
for
portal_type
,
wf_id_list
in
six
.
iteritems
(
self
.
_chains_by_type
):
for
wf_id
in
wf_id_list
:
for
wf_id
in
wf_id_list
:
chain_dict
.
setdefault
(
wf_id
,
[]).
append
(
portal_type
)
chain_dict
.
setdefault
(
wf_id
,
[]).
append
(
portal_type
)
return
chain_dict
return
chain_dict
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getChainDict'
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getChainDict'
)
WorkflowTool
.
getChainDict
=
WorkflowTool_getChainDict
WorkflowTool
.
getChainDict
=
WorkflowTool_getChainDict
# Backward compatibility, as WorkflowMethod has been removed in CMFCore 2.2
# Backward compatibility, as WorkflowMethod has been removed in CMFCore 2.2
from
MethodObject
import
Method
from
MethodObject
import
Method
class
WorkflowMethod
(
Method
):
class
WorkflowMethod
(
Method
):
""" Wrap a method to workflow-enable it.
""" Wrap a method to workflow-enable it.
"""
"""
...
@@ -150,14 +151,14 @@ class WorkflowMethod( Method ):
...
@@ -150,14 +151,14 @@ class WorkflowMethod( Method ):
res
=
wf
.
wrapWorkflowMethod
(
instance
,
self
.
_id
,
self
.
_m
,
res
=
wf
.
wrapWorkflowMethod
(
instance
,
self
.
_id
,
self
.
_m
,
(
instance
,)
+
args
,
kw
)
(
instance
,)
+
args
,
kw
)
from
Products.CMFCore
import
WorkflowCore
from
Products.CMFCore
import
WorkflowCore
# BBB: WorkflowMethod has been removed from CMFCore 2
# BBB: WorkflowMethod has been removed from CMFCore 2
WorkflowCore
.
WorkflowAction
=
WorkflowMethod
WorkflowCore
.
WorkflowAction
=
WorkflowMethod
# XXX: Kept here instead of ERP5Type.Tool.WorkflowTool because not used in
# XXX: Kept here instead of ERP5Type.Tool.WorkflowTool because not used in
# erp5.git: is it used in projects?
# erp5.git: is it used in projects?
security
.
declarePublic
(
'canDoActionFor'
)
security
.
declarePublic
(
'canDoActionFor'
)
def
canDoActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
guard_kw
=
{}):
def
canDoActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
guard_kw
=
{}):
""" Check we can perform the given workflow action on 'ob'.
""" Check we can perform the given workflow action on 'ob'.
"""
"""
if
wf_id
is
None
:
if
wf_id
is
None
:
...
@@ -180,10 +181,10 @@ def canDoActionFor(self, ob, action, wf_id=None, guard_kw={}):
...
@@ -180,10 +181,10 @@ def canDoActionFor(self, ob, action, wf_id=None, guard_kw={}):
raise
WorkflowException
(
_
(
u"No workflow provides the '${action_id}' action."
,
raise
WorkflowException
(
_
(
u"No workflow provides the '${action_id}' action."
,
mapping
=
{
'action_id'
:
action
}))
mapping
=
{
'action_id'
:
action
}))
WorkflowTool
.
canDoActionFor
=
canDoActionFor
WorkflowTool
.
canDoActionFor
=
canDoActionFor
security
.
declarePrivate
(
'_listTypeInfo'
)
security
.
declarePrivate
(
'_listTypeInfo'
)
def
_listTypeInfo
(
self
):
def
_listTypeInfo
(
self
):
""" List the portal types which are available.
""" List the portal types which are available.
"""
"""
# <patch>
# <patch>
...
@@ -193,17 +194,17 @@ def _listTypeInfo(self):
...
@@ -193,17 +194,17 @@ def _listTypeInfo(self):
return
ttool
.
listTypeInfo
()
return
ttool
.
listTypeInfo
()
return
()
return
()
WorkflowTool
.
_listTypeInfo
=
_listTypeInfo
WorkflowTool
.
_listTypeInfo
=
_listTypeInfo
## From here on: migration/compatibility code DCWorkflow => ERP5 Workflow
## From here on: migration/compatibility code DCWorkflow => ERP5 Workflow
# The following 2 functions are necessary for workflow tool dynamic migration
# The following 2 functions are necessary for workflow tool dynamic migration
def
WorkflowTool_isBootstrapRequired
(
self
):
def
WorkflowTool_isBootstrapRequired
(
self
):
# migration is required if the tool is not the new one from ERP5 Workflow
# migration is required if the tool is not the new one from ERP5 Workflow
# in case of old workflow tool, it acquires the portal type from ERP5 Site
# in case of old workflow tool, it acquires the portal type from ERP5 Site
return
self
.
getPortalType
()
!=
"Workflow Tool"
return
self
.
getPortalType
()
!=
"Workflow Tool"
def
WorkflowTool_bootstrap
(
self
):
def
WorkflowTool_bootstrap
(
self
):
"""
"""
Migrate portal_workflow from CMFCore to ERP5 Workflow. Also migrate
Migrate portal_workflow from CMFCore to ERP5 Workflow. Also migrate
Workflow Chains not defined anymore on portal_workflow but on the Portal
Workflow Chains not defined anymore on portal_workflow but on the Portal
...
@@ -244,20 +245,20 @@ def WorkflowTool_bootstrap(self):
...
@@ -244,20 +245,20 @@ def WorkflowTool_bootstrap(self):
if
getattr
(
new_tool
,
'_chains_by_type'
,
None
)
is
not
None
:
if
getattr
(
new_tool
,
'_chains_by_type'
,
None
)
is
not
None
:
new_tool
.
reassignWorkflowWithoutConversion
()
new_tool
.
reassignWorkflowWithoutConversion
()
WorkflowTool
.
_isBootstrapRequired
=
WorkflowTool_isBootstrapRequired
WorkflowTool
.
_isBootstrapRequired
=
WorkflowTool_isBootstrapRequired
WorkflowTool
.
_bootstrap
=
WorkflowTool_bootstrap
WorkflowTool
.
_bootstrap
=
WorkflowTool_bootstrap
WorkflowTool
.
getWorkflowValueListFor
=
WorkflowTool
.
getWorkflowsFor
WorkflowTool
.
getWorkflowValueListFor
=
WorkflowTool
.
getWorkflowsFor
def
_deleteChainsByType
(
self
,
pt
,
wf_id
):
def
_deleteChainsByType
(
self
,
pt
,
wf_id
):
self
.
_chains_by_type
[
pt
]
=
tuple
(
wf
for
wf
in
self
.
_chains_by_type
[
pt
]
if
wf
!=
wf_id
)
self
.
_chains_by_type
[
pt
]
=
tuple
(
wf
for
wf
in
self
.
_chains_by_type
[
pt
]
if
wf
!=
wf_id
)
def
getChainsByType
(
self
):
def
getChainsByType
(
self
):
# XXX(WORKFLOW): compatibility code
# XXX(WORKFLOW): compatibility code
# get old workflow tool's chains_by_type
# get old workflow tool's chains_by_type
if
self
.
_chains_by_type
is
None
:
if
self
.
_chains_by_type
is
None
:
return
{}
return
{}
return
self
.
_chains_by_type
.
copy
()
return
self
.
_chains_by_type
.
copy
()
WorkflowTool
.
getChainsByType
=
getChainsByType
WorkflowTool
.
getChainsByType
=
getChainsByType
def
reassignWorkflow
(
self
,
workflow_id
):
def
reassignWorkflow
(
self
,
workflow_id
):
# type-workflow reassignment
# type-workflow reassignment
type_workflow_dict
=
self
.
getChainsByType
()
type_workflow_dict
=
self
.
getChainsByType
()
type_tool
=
self
.
getPortalObject
().
portal_types
type_tool
=
self
.
getPortalObject
().
portal_types
...
@@ -274,8 +275,8 @@ def reassignWorkflow(self, workflow_id):
...
@@ -274,8 +275,8 @@ def reassignWorkflow(self, workflow_id):
portal_type
.
setTypeWorkflowList
(
portal_type
.
setTypeWorkflowList
(
type_workflow_list
+
[
workflow_id
]
type_workflow_list
+
[
workflow_id
]
)
)
WorkflowTool
.
reassignWorkflow
=
reassignWorkflow
WorkflowTool
.
reassignWorkflow
=
reassignWorkflow
def
reassignWorkflowWithoutConversion
(
self
):
def
reassignWorkflowWithoutConversion
(
self
):
# This function should be called when a new template installed and add
# This function should be called when a new template installed and add
# portal_types assignment with converted and non-converted workflows into
# portal_types assignment with converted and non-converted workflows into
# portal_type's workflow list.
# portal_type's workflow list.
...
@@ -305,10 +306,10 @@ def reassignWorkflowWithoutConversion(self):
...
@@ -305,10 +306,10 @@ def reassignWorkflowWithoutConversion(self):
portal_type
.
setTypeWorkflowList
(
portal_type
.
setTypeWorkflowList
(
type_workflow_list
+
[
workflow_id
]
type_workflow_list
+
[
workflow_id
]
)
)
WorkflowTool
.
reassignWorkflowWithoutConversion
=
reassignWorkflowWithoutConversion
WorkflowTool
.
reassignWorkflowWithoutConversion
=
reassignWorkflowWithoutConversion
WorkflowTool
.
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
WorkflowTool
.
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getWorkflowTempObjectList'
)
'getWorkflowTempObjectList'
)
def
getWorkflowTempObjectList
(
self
,
temp_object
=
1
,
**
kw
):
def
getWorkflowTempObjectList
(
self
,
temp_object
=
1
,
**
kw
):
""" Return a list of converted temporary workflows. Only necessary in
""" Return a list of converted temporary workflows. Only necessary in
Workflow Tool to get temporarilly converted DCWorkflow.
Workflow Tool to get temporarilly converted DCWorkflow.
"""
"""
...
@@ -320,6 +321,6 @@ def getWorkflowTempObjectList(self, temp_object=1, **kw):
...
@@ -320,6 +321,6 @@ def getWorkflowTempObjectList(self, temp_object=1, **kw):
temp_workflow
=
dc_workflow
.
convertToERP5Workflow
(
temp_object
=
temp_object
)
temp_workflow
=
dc_workflow
.
convertToERP5Workflow
(
temp_object
=
temp_object
)
temp_workflow_list
.
append
(
temp_workflow
)
temp_workflow_list
.
append
(
temp_workflow
)
return
temp_workflow_list
return
temp_workflow_list
WorkflowTool
.
getWorkflowTempObjectList
=
getWorkflowTempObjectList
WorkflowTool
.
getWorkflowTempObjectList
=
getWorkflowTempObjectList
InitializeClass
(
WorkflowTool
)
InitializeClass
(
WorkflowTool
)
product/ERP5Type/tests/SecurityTestCase.py
View file @
a0dfb228
...
@@ -38,7 +38,6 @@ from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
...
@@ -38,7 +38,6 @@ from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Base
import
Base
...
...
product/ERP5Type/tests/testERP5NamingConvention.py
View file @
a0dfb228
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
import
unittest
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
class
TestNamingConvention
(
ERP5TypeTestCase
):
class
TestNamingConvention
(
ERP5TypeTestCase
):
...
@@ -65,7 +66,7 @@ class TestNamingConvention(ERP5TypeTestCase):
...
@@ -65,7 +66,7 @@ class TestNamingConvention(ERP5TypeTestCase):
'erp5_promise'
,
'erp5_software_pdm'
,
'erp5_sso_openam'
,
'erp5_jquery_plugin_hotkey'
,
'erp5_promise'
,
'erp5_software_pdm'
,
'erp5_sso_openam'
,
'erp5_jquery_plugin_hotkey'
,
'erp5_jquery_plugin_jgraduate'
,
'erp5_jquery_plugin_svgicon'
,
'erp5_jquery_plugin_jquerybbq'
,
'erp5_jquery_plugin_jgraduate'
,
'erp5_jquery_plugin_svgicon'
,
'erp5_jquery_plugin_jquerybbq'
,
'erp5_jquery_plugin_spinbtn'
,
'erp5_jquery_plugin_svg_editor'
,
'erp5_svg_editor'
,
'erp5_syncml'
,
'erp5_jquery_plugin_spinbtn'
,
'erp5_jquery_plugin_svg_editor'
,
'erp5_svg_editor'
,
'erp5_syncml'
,
'erp5_system_event'
,
'erp5_tiosafe_core'
,
'erp5_workflow_test'
,
'erp5_system_event'
,
'erp5_tiosafe_core'
,
'erp5_public_accounting_budget'
,
'erp5_publication'
,
'erp5_public_accounting_budget'
,
'erp5_publication'
,
'erp5_social_contracts'
,
'test_core'
,
'test_accounting'
,
'test_web'
,
'test_html_style'
,
'erp5_social_contracts'
,
'test_core'
,
'test_accounting'
,
'test_web'
,
'test_html_style'
,
'test_xhtml_style'
,
'cloudooo_data'
,
'cloudooo_web'
,
'erp5_configurator'
,
'test_xhtml_style'
,
'cloudooo_data'
,
'cloudooo_web'
,
'erp5_configurator'
,
...
@@ -79,7 +80,7 @@ class TestNamingConvention(ERP5TypeTestCase):
...
@@ -79,7 +80,7 @@ class TestNamingConvention(ERP5TypeTestCase):
# 'erp5_accounting_l10n_pl',
# 'erp5_accounting_l10n_pl',
# 'erp5_accounting_l10n_sn',
# 'erp5_accounting_l10n_sn',
# 'erp5_accounting_l10n_in',
# 'erp5_accounting_l10n_in',
)
)
+
((
'erp5_workflow_test'
,)
if
WITH_LEGACY_WORKFLOW
else
())
def
getTitle
(
self
):
def
getTitle
(
self
):
return
"Naming Convention"
return
"Naming Convention"
...
...
product/ERP5Type/tests/testUpgradeInstanceWithOldDataFs.py
View file @
a0dfb228
...
@@ -26,7 +26,9 @@
...
@@ -26,7 +26,9 @@
#
#
##############################################################################
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
import
StringIO
import
StringIO
import
unittest
import
urllib
import
urllib
import
httplib
import
httplib
...
@@ -149,3 +151,9 @@ class TestUpgradeInstanceWithOldDataFs(ERP5TypeTestCase):
...
@@ -149,3 +151,9 @@ class TestUpgradeInstanceWithOldDataFs(ERP5TypeTestCase):
self
.
assertEquals
(
self
.
assertEquals
(
error_list
,
[],
error_list
,
[],
msg
=
"The following Portal Type classes could not be loaded (see zLOG.log): %r"
%
error_list
)
msg
=
"The following Portal Type classes could not be loaded (see zLOG.log): %r"
%
error_list
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
if
WITH_LEGACY_WORKFLOW
:
suite
.
addTest
(
unittest
.
makeSuite
(
TestUpgradeInstanceWithOldDataFs
))
return
suite
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