Commit 2d4a043c authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: do not explode the workflow history with the same comment

parent b0c82b31
...@@ -13,9 +13,12 @@ if portal.portal_activities.countMessageWithTag(tag) > 0: ...@@ -13,9 +13,12 @@ if portal.portal_activities.countMessageWithTag(tag) > 0:
# nothing to do # nothing to do
return return
def storeWorkflowComment(document, comment): def storeWorkflowComment(document, comment):
portal.portal_workflow.doActionFor(document, 'edit_action', comment=comment) portal_workflow = document.portal_workflow
last_workflow_item = portal_workflow.getInfoFor(ob=document,
name='comment', wf_id='edit_workflow')
if last_workflow_item != comment:
portal_workflow.doActionFor(document, action='edit_action', comment=comment)
def newOpenOrder(start_date, service, def newOpenOrder(start_date, service,
......
...@@ -17,7 +17,11 @@ if portal.portal_activities.countMessageWithTag(tag) > 0: ...@@ -17,7 +17,11 @@ if portal.portal_activities.countMessageWithTag(tag) > 0:
def storeWorkflowComment(document, comment): def storeWorkflowComment(document, comment):
portal.portal_workflow.doActionFor(document, 'edit_action', comment=comment) portal_workflow = document.portal_workflow
last_workflow_item = portal_workflow.getInfoFor(ob=document,
name='comment', wf_id='edit_workflow')
if last_workflow_item != comment:
portal_workflow.doActionFor(document, action='edit_action', comment=comment)
def calculateOpenOrderLineStopDate(open_order_line, hosting_subscription, instance_tree, start_date_delta, next_stop_date_delta=0): def calculateOpenOrderLineStopDate(open_order_line, hosting_subscription, instance_tree, start_date_delta, next_stop_date_delta=0):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment