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
Amer
erp5
Commits
45877650
Commit
45877650
authored
Mar 18, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
override method due to unknown behaviour
parent
3c4cd011
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
product/ERP5SyncML/Conduit/ERP5DocumentConduit.py
product/ERP5SyncML/Conduit/ERP5DocumentConduit.py
+37
-0
No files found.
product/ERP5SyncML/Conduit/ERP5DocumentConduit.py
View file @
45877650
...
@@ -34,6 +34,10 @@ from AccessControl import ClassSecurityInfo
...
@@ -34,6 +34,10 @@ from AccessControl import ClassSecurityInfo
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
WORKFLOW_ACTION_NOT_ADDABLE
=
0
WORKFLOW_ACTION_ADDABLE
=
1
WORKFLOW_ACTION_INSERTABLE
=
2
class
ERP5DocumentConduit
(
ERP5Conduit
):
class
ERP5DocumentConduit
(
ERP5Conduit
):
"""
"""
ERP5DocumentConduit specialise generic Conduit
ERP5DocumentConduit specialise generic Conduit
...
@@ -52,3 +56,36 @@ class ERP5DocumentConduit(ERP5Conduit):
...
@@ -52,3 +56,36 @@ class ERP5DocumentConduit(ERP5Conduit):
return
"%s-%s-%s"
%
\
return
"%s-%s-%s"
%
\
(
object
.
getReference
(),
object
.
getVersion
(),
object
.
getLanguage
())
(
object
.
getReference
(),
object
.
getVersion
(),
object
.
getLanguage
())
def
isWorkflowActionAddable
(
self
,
document
,
status
,
wf_id
):
"""
Some checking in order to check if we should add the workfow or not
We should not returns a conflict list as we wanted before, we should
instead go to a conflict state.
"""
# We first test if the status in not already inside the workflow_history
wf_history
=
document
.
workflow_history
if
wf_id
in
wf_history
:
action_list
=
wf_history
[
wf_id
]
else
:
return
WORKFLOW_ACTION_ADDABLE
addable
=
WORKFLOW_ACTION_ADDABLE
time
=
status
.
get
(
'time'
)
for
action
in
action_list
:
this_one
=
WORKFLOW_ACTION_ADDABLE
# if time <= action.get('time'):
# # action in the past are not appended
# addable = WORKFLOW_ACTION_INSERTABLE
key_list
=
action
.
keys
()
# key_list.remove("time")
# XXX-AUREL For document it seems that checking time != is required
# I don't know why ?
for
key
in
key_list
:
if
status
[
key
]
!=
action
[
key
]:
this_one
=
WORKFLOW_ACTION_NOT_ADDABLE
break
if
this_one
:
addable
=
WORKFLOW_ACTION_NOT_ADDABLE
break
return
addable
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