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
Levin Zimmermann
erp5
Commits
e18c21d7
Commit
e18c21d7
authored
Apr 14, 2021
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Use new API.
parent
9612e94d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
35 deletions
+38
-35
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/script_validateTransactionLines.py
...ow/accounting_workflow/script_validateTransactionLines.py
+2
-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_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
+2
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testMassWorkflowTransition.zpt
...al_tests/renderjs_ui_zuite/testMassWorkflowTransition.zpt
+8
-8
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Module_listWorkflowTransitionItemList.py
..._skins/erp5_core/Module_listWorkflowTransitionItemList.py
+22
-21
No files found.
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/script_validateTransactionLines.py
View file @
e18c21d7
...
@@ -13,7 +13,8 @@ section_portal_type_list = ['Person', 'Organisation']
...
@@ -13,7 +13,8 @@ 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
)
script_id
=
container
.
getScriptIdByReference
(
'validateTransaction'
)
container
.
getScriptValueById
(
script_id
)(
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 @
e18c21d7
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()]
(
sci
)
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
.
getScriptValueById
(
script
.
getId
())
(
sci
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_resetGroupingReference.py
View file @
e18c21d7
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()]
(
sci
)
return
sci
.
getPortal
().
portal_workflow
.
accounting_workflow
.
getScriptValueById
(
script
.
getId
())
(
sci
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_setReferences.py
View file @
e18c21d7
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()]
(
state_change
)
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
getScriptValueById
(
script
.
getId
())
(
state_change
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_validateTransaction.py
View file @
e18c21d7
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
scripts
[
script
.
getId
()]
(
state_change
)
return
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
getScriptValueById
(
script
.
getId
())
(
state_change
)
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/internal_invoice_transaction_simulation_workflow/script_validateTransactionLines.py
View file @
e18c21d7
...
@@ -7,4 +7,5 @@ if old_state.getId() == 'draft':
...
@@ -7,4 +7,5 @@ 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
)
script
=
state_change
.
getPortal
().
portal_workflow
.
accounting_workflow
.
getScriptValueById
(
script
.
getId
())
return
script
(
state_change
)
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testMassWorkflowTransition.zpt
View file @
e18c21d7
...
@@ -57,9 +57,9 @@
...
@@ -57,9 +57,9 @@
<tr><td>
waitForElementPresent
</td>
<tr><td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_mass_workflow_action"]/option
</td><td></td></tr>
<td>
//select[@name="field_your_mass_workflow_action"]/option
</td><td></td></tr>
<tr><td>
assertElementPresent
</td>
<tr><td>
assertElementPresent
</td>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="
transition_
validate_action"]
</td><td></td></tr>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="validate_action"]
</td><td></td></tr>
<tr><td>
assertElementPresent
</td>
<tr><td>
assertElementPresent
</td>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="
transition_
invalidate_action"]
</td><td></td></tr>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="invalidate_action"]
</td><td></td></tr>
<tr><th
colspan=
"3"
>
Search
<em>
( title: "Title 1%" OR title: "Title 3%" )
</em>
so we work on subset
</th></tr>
<tr><th
colspan=
"3"
>
Search
<em>
( title: "Title 1%" OR title: "Title 3%" )
</em>
so we work on subset
</th></tr>
<tr><td>
click
</td>
<tr><td>
click
</td>
...
@@ -77,10 +77,10 @@
...
@@ -77,10 +77,10 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr><td>
waitForElementPresent
</td>
<tr><td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="
transition_
validate_action"]
</td><td></td></tr>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="validate_action"]
</td><td></td></tr>
<tr><td>
select
</td>
<tr><td>
select
</td>
<td>
//select[@name="field_your_mass_workflow_action"]
</td>
<td>
//select[@name="field_your_mass_workflow_action"]
</td>
<td>
value=
transition_
validate_action
</td></tr>
<td>
value=validate_action
</td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
...
@@ -157,10 +157,10 @@
...
@@ -157,10 +157,10 @@
<tr><td>
waitForElementPresent
</td>
<tr><td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="
transition_
invalidate_action"]
</td><td></td></tr>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="invalidate_action"]
</td><td></td></tr>
<tr><td>
select
</td>
<tr><td>
select
</td>
<td>
//select[@name="field_your_mass_workflow_action"]
</td>
<td>
//select[@name="field_your_mass_workflow_action"]
</td>
<td>
value=
transition_
invalidate_action
</td></tr>
<td>
value=invalidate_action
</td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
...
@@ -175,10 +175,10 @@
...
@@ -175,10 +175,10 @@
<tr><td>
waitForElementPresent
</td>
<tr><td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="
transition_
validate_action"]
</td><td></td></tr>
<td>
//select[@name="field_your_mass_workflow_action"]/option[@value="validate_action"]
</td><td></td></tr>
<tr><td>
select
</td>
<tr><td>
select
</td>
<td>
//select[@name="field_your_mass_workflow_action"]
</td>
<td>
//select[@name="field_your_mass_workflow_action"]
</td>
<td>
value=
transition_
validate_action
</td></tr>
<td>
value=validate_action
</td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Module_listWorkflowTransitionItemList.py
View file @
e18c21d7
...
@@ -21,37 +21,38 @@ checked_workflow_id_dict = {}
...
@@ -21,37 +21,38 @@ checked_workflow_id_dict = {}
for
document_portal_type_id
in
module_portal_type
.
getTypeAllowedContentTypeList
():
for
document_portal_type_id
in
module_portal_type
.
getTypeAllowedContentTypeList
():
if
(
filter_portal_type_list
is
not
None
)
and
(
document_portal_type_id
not
in
filter_portal_type_list
):
if
(
filter_portal_type_list
is
not
None
)
and
(
document_portal_type_id
not
in
filter_portal_type_list
):
continue
continue
for
workflow
in
workflow_tool
.
getWorkflowsFor
(
document_portal_type_id
):
for
workflow
in
workflow_tool
.
getWorkflowValueListFor
(
document_portal_type_id
):
if
workflow
.
id
not
in
checked_workflow_id_dict
:
workflow_id
=
workflow
.
getId
()
if
workflow_id
not
in
checked_workflow_id_dict
:
# Do not check the same workflow twice
# Do not check the same workflow twice
checked_workflow_id_dict
[
workflow
.
id
]
=
None
checked_workflow_id_dict
[
workflow
_
id
]
=
None
state_variable
=
workflow
.
state_var
state_variable
=
workflow
.
getStateVariable
()
allowed_state_dict
=
{}
allowed_state_dict
=
{}
if
getattr
(
workflow
,
'states'
,
None
)
is
not
None
:
state_value_list
=
workflow
.
getStateValueList
()
for
state_id
,
state
in
workflow
.
states
.
items
():
if
state_value_list
:
for
possible_transition_id
in
state
.
transitions
:
for
state
in
state_value_list
:
if
possible_transition_id
in
allowed_state_dict
:
state_reference
=
state
.
getReference
()
allowed_state_dict
[
possible_transition_id
].
append
(
state_id
)
for
possible_transition
in
state
.
getDestinationValueList
():
if
possible_transition
in
allowed_state_dict
:
allowed_state_dict
[
possible_transition
].
append
(
state_reference
)
else
:
else
:
allowed_state_dict
[
possible_transition_id
]
=
[
state_id
]
allowed_state_dict
[
possible_transition
]
=
[
state_reference
]
for
transition_id
in
allowed_state_dict
:
for
transition
in
allowed_state_dict
:
transition
=
workflow
.
transitions
.
get
(
transition_id
,
None
)
transition_reference
=
transition
.
getReference
()
if
transition
is
None
:
continue
# Only display user action transition with a dialog to show to user
# Only display user action transition with a dialog to show to user
if
(
transition
.
trigger_type
==
TRIGGER_USER_ACTION
)
and
(
transition
.
actbox_url
)
and
(
transition
.
actbox_name
):
if
transition
.
getTriggerType
()
==
TRIGGER_USER_ACTION
and
transition
.
getAction
()
and
transition
.
getActionName
(
):
action_form_id
=
transition
.
actbox_url
.
rsplit
(
'/'
,
1
)[
1
].
split
(
'?'
)[
0
]
action_form_id
=
transition
.
getAction
()
.
rsplit
(
'/'
,
1
)[
1
].
split
(
'?'
)[
0
]
result
[
'transition_item_list'
].
append
((
translate
(
transition
.
actbox_name
),
transition_id
))
result
[
'transition_item_list'
].
append
((
translate
(
transition
.
getActionName
()),
transition_reference
))
result
[
'form_id_dict'
][
transition_
id
]
=
action_form_id
result
[
'form_id_dict'
][
transition_
reference
]
=
action_form_id
# XXX portal_type parameter must also probably be added too
# XXX portal_type parameter must also probably be added too
# This would required to detect identical transition id for different workflow
# This would required to detect identical transition id for different workflow
result
[
'listbox_parameter_dict'
][
transition_
id
]
=
[(
state_variable
,
allowed_state_dict
[
transition_id
])]
result
[
'listbox_parameter_dict'
][
transition_
reference
]
=
[(
state_variable
,
allowed_state_dict
[
transition
])]
elif
(
transition
.
trigger_type
==
TRIGGER_USER_ACTION
)
and
(
transition_id
==
'delete_action'
)
:
elif
transition
.
getTriggerType
()
==
TRIGGER_USER_ACTION
and
transition_reference
==
'delete_action'
:
result
[
'listbox_parameter_dict'
][
transition_
id
]
=
[(
state_variable
,
allowed_state_dict
[
transition_id
])]
result
[
'listbox_parameter_dict'
][
transition_
reference
]
=
[(
state_variable
,
allowed_state_dict
[
transition
])]
result
[
'transition_item_list'
].
sort
()
result
[
'transition_item_list'
].
sort
()
result
[
'transition_item_list'
].
insert
(
0
,
(
''
,
''
))
result
[
'transition_item_list'
].
insert
(
0
,
(
''
,
''
))
...
...
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