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
Laurent S
erp5
Commits
bb390370
Commit
bb390370
authored
Mar 15, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not check time value twice
parent
60a10435
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
product/ERP5SyncML/Conduit/ERP5Conduit.py
product/ERP5SyncML/Conduit/ERP5Conduit.py
+9
-11
No files found.
product/ERP5SyncML/Conduit/ERP5Conduit.py
View file @
bb390370
...
...
@@ -34,8 +34,6 @@ from Products.ERP5Type.XMLExportImport import MARSHALLER_NAMESPACE_URI
from
Products.CMFCore.utils
import
getToolByName
from
Products.ERP5Type.Base
import
WorkflowMethod
from
DateTime.DateTime
import
DateTime
from
email.mime.base
import
MIMEBase
from
email
import
encoders
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
interfaces
from
Products.ERP5Type.Globals
import
PersistentMapping
...
...
@@ -892,15 +890,14 @@ class ERP5Conduit(XMLSyncUtilsMixin):
**update_dict)
return conflict_list
def isWorkflowActionAddable(self, object=None, status=None, wf_tool=None,
wf_id=None, xml=None):
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 =
objec
t.workflow_history
wf_history =
documen
t.workflow_history
if wf_id in wf_history:
action_list = wf_history[wf_id]
else:
...
...
@@ -910,9 +907,11 @@ class ERP5Conduit(XMLSyncUtilsMixin):
for action in action_list:
this_one = WORKFLOW_ACTION_ADDABLE
if time <= action.get('time'):
# action in the past are not append
# action in the past are not append
ed
addable = WORKFLOW_ACTION_INSERTABLE
for key in action.keys():
key_list = action.keys()
key_list.remove("time")
for key in key_list:
if status[key] != action[key]:
this_one = WORKFLOW_ACTION_NOT_ADDABLE
break
...
...
@@ -948,10 +947,9 @@ class ERP5Conduit(XMLSyncUtilsMixin):
#for action in self.getWorkflowActionFromXml(xml):
status = self.getStatusFromXml(xml)
#LOG('addNode, status:',0,status)
add_action = self.isWorkflowActionAddable(object=object,
status=status,wf_tool=wf_tool,
wf_id=wf_id,xml=xml)
add_action = self.isWorkflowActionAddable(document=object,
status=status,
wf_id=wf_id,)
if not simulate:
if add_action == WORKFLOW_ACTION_ADDABLE:
wf_tool.setStatusOf(wf_id, object, status)
...
...
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