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
c6638f2b
Commit
c6638f2b
authored
May 14, 2018
by
Tomáš Peterka
Committed by
Romain Courteaud
Jun 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hal_json] Support aborting transaction
parent
b43bed09
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
4 deletions
+44
-4
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.py
...ountingTransactionModule_createReversalTransactionList.py
+6
-3
bt5/erp5_hal_json_style/ExtensionTemplateItem/portal_components/extension.erp5.HalStyle.py
...TemplateItem/portal_components/extension.erp5.HalStyle.py
+4
-0
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
...ateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
+5
-0
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.xml
...teItem/portal_skins/erp5_hal_json_style/Base_redirect.xml
+1
-1
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Portal_abortTransaction.xml
...tal_skins/erp5_hal_json_style/Portal_abortTransaction.xml
+28
-0
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.py
View file @
c6638f2b
...
@@ -24,9 +24,12 @@ for obj in object_list:
...
@@ -24,9 +24,12 @@ for obj in object_list:
obj
=
obj
.
getObject
()
obj
=
obj
.
getObject
()
if
countMessage
(
path
=
obj
.
getPath
(),
if
countMessage
(
path
=
obj
.
getPath
(),
method_id
=
'AccountingTransaction_createReversalTransaction'
):
method_id
=
'AccountingTransaction_createReversalTransaction'
):
raise
Redirect
,
"%s/view?portal_status_message=%s"
%
(
return
context
.
Base_redirect
(
form_id
,
context
.
absolute_url
(),
translateString
(
abort_transaction
=
True
,
'Reversal creation already in progress, abandon.'
))
keep_items
=
{
"portal_status_message"
:
translateString
(
'Reversal creation already in progress, abandon.'
),
"portal_status_level"
:
'error'
})
obj
.
activate
(
tag
=
tag
).
AccountingTransaction_createReversalTransaction
(
obj
.
activate
(
tag
=
tag
).
AccountingTransaction_createReversalTransaction
(
cancellation_amount
=
cancellation_amount
,
cancellation_amount
=
cancellation_amount
,
date
=
date
,
date
=
date
,
...
...
bt5/erp5_hal_json_style/ExtensionTemplateItem/portal_components/extension.erp5.HalStyle.py
View file @
c6638f2b
...
@@ -9,6 +9,10 @@ def Base_aqBase(self):
...
@@ -9,6 +9,10 @@ def Base_aqBase(self):
def
Base_aqInner
(
self
):
def
Base_aqInner
(
self
):
return
aq_inner
(
self
)
return
aq_inner
(
self
)
def
Portal_abortTransaction
(
self
):
import
transaction
transaction
.
abort
()
def
Field_getSubFieldKeyDict
(
self
,
field
,
field_id
,
key
=
None
):
def
Field_getSubFieldKeyDict
(
self
,
field
,
field_id
,
key
=
None
):
"""XXX"""
"""XXX"""
return
field
.
generate_subfield_key
(
field_id
,
key
=
key
)
return
field
.
generate_subfield_key
(
field_id
,
key
=
key
)
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
View file @
c6638f2b
...
@@ -6,6 +6,11 @@
...
@@ -6,6 +6,11 @@
from
ZTUtils
import
make_query
from
ZTUtils
import
make_query
import
json
import
json
if
abort_transaction
:
# Old UI simply throws a Redirect exception and Published does its job
# but we cannot use it here so we abort using External Method
context
.
getPortalObject
().
Portal_abortTransaction
()
request_form
=
context
.
REQUEST
.
form
request_form
=
context
.
REQUEST
.
form
request_form
.
update
(
kw
)
request_form
.
update
(
kw
)
request_form
=
context
.
ERP5Site_filterParameterList
(
request_form
)
request_form
=
context
.
ERP5Site_filterParameterList
(
request_form
)
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.xml
View file @
c6638f2b
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
form_id=\'view\', keep_items={}, **kw
</string>
</value>
<value>
<string>
form_id=\'view\', keep_items={},
abort_transaction=False,
**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Portal_abortTransaction.xml
0 → 100644
View file @
c6638f2b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
Portal_abortTransaction
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
HalStyle
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Portal_abortTransaction
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Abort Current Transaction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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