Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
Commits
aa3a313d
Commit
aa3a313d
authored
Apr 23, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New serialise...State accessor
This will be required to fix a possible race condition in causality_workflow
parent
c2e4e557
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
product/ERP5Type/Accessor/WorkflowState.py
product/ERP5Type/Accessor/WorkflowState.py
+14
-0
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+3
-1
No files found.
product/ERP5Type/Accessor/WorkflowState.py
View file @
aa3a313d
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#
#
##############################################################################
##############################################################################
from
Acquisition
import
aq_base
from
Products.ERP5Type.PsycoWrapper
import
psyco
from
Products.ERP5Type.PsycoWrapper
import
psyco
from
Base
import
Getter
as
BaseGetter
,
Setter
as
BaseSetter
from
Base
import
Getter
as
BaseGetter
,
Setter
as
BaseSetter
from
warnings
import
warn
from
warnings
import
warn
...
@@ -120,3 +121,16 @@ class TranslatedTitleGetter(TitleGetter):
...
@@ -120,3 +121,16 @@ class TranslatedTitleGetter(TitleGetter):
return
result
.
encode
(
'utf8'
)
return
result
.
encode
(
'utf8'
)
psyco
.
bind
(
__call__
)
psyco
.
bind
(
__call__
)
def
SerializeGetter
(
id
,
key
):
def
serialize
(
self
):
"""Prevent concurrent transaction from changing of state of this object
"""
try
:
self
=
aq_base
(
self
).
workflow_history
self
=
self
[
key
]
except
(
AttributeError
,
KeyError
):
pass
self
.
_p_changed
=
1
serialize
.
__name__
=
id
return
serialize
product/ERP5Type/Base.py
View file @
aa3a313d
...
@@ -518,7 +518,9 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
...
@@ -518,7 +518,9 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
(
'getTranslated%s'
%
UpperCase
(
state_var
),
(
'getTranslated%s'
%
UpperCase
(
state_var
),
WorkflowState
.
TranslatedGetter
),
WorkflowState
.
TranslatedGetter
),
(
'getTranslated%sTitle'
%
UpperCase
(
state_var
),
(
'getTranslated%sTitle'
%
UpperCase
(
state_var
),
WorkflowState
.
TranslatedTitleGetter
)):
WorkflowState
.
TranslatedTitleGetter
),
(
'serialize%s'
%
UpperCase
(
state_var
),
WorkflowState
.
SerializeGetter
),
):
if
not
hasattr
(
ptype_klass
,
method_id
):
if
not
hasattr
(
ptype_klass
,
method_id
):
method
=
getter
(
method_id
,
wf_id
)
method
=
getter
(
method_id
,
wf_id
)
# Attach to portal_type
# Attach to portal_type
...
...
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