Commit f6eebe13 authored by Sebastien Robin's avatar Sebastien Robin

* It was a mistake to edit the comment property, the intention

  was to display information in the workflow history (edit workflow)
* it is useless to set things in the workflow history here, it is
  already done in the user interface and stored in the causality
  workflow
* Check that when we solve a divergency we do not loose comment
  on the delivery

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28971 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bb9461d5
......@@ -189,11 +189,10 @@ class DeliveryBuilder(OrderBuilder):
return solveDeliveryGroupDivergence(*args, **kw)
def _solveDeliveryGroupDivergence(self, delivery_relative_url,
property_dict=None, comment=None):
property_dict=None):
if property_dict in (None, {}):
return
delivery = self.getPortalObject().restrictedTraverse(delivery_relative_url)
delivery.edit(comment=comment)
for (property, value) in property_dict.iteritems():
delivery.setPropertyList(property, value)
......
......@@ -105,6 +105,29 @@ class TestTaskReportDivergenceMixin(TestTaskMixin):
rule_tool.Base_setDefaultSecurity()
self.logout()
def stepChangeCommentOnTaskReport(self, sequence=None, **kw):
task_report = sequence.get('task_report')
task_report.edit(comment='foo')
self.assertEquals('foo', task_report.getComment())
def stepAcceptDateDecision(self, sequence=None, **kw):
task_report = sequence.get('task_report')
# XXX This is not really cool, when we will have nice api, it is required
# to use it
self.getPortal().portal_deliveries\
.task_report_builder.solveDeliveryGroupDivergence(
task_report.getRelativeUrl(),
property_dict={'start_date':[self.datetime + 15]})
def stepCheckCommentStillOnTaskReport(self, sequence=None, **kw):
"""
It already happened that the action of solving divergence
erased the comment on the delivery. We make sure that was is
logical (the comment remains) is true
"""
task_report = sequence.get('task_report')
self.assertEquals('foo', task_report.getComment())
class TestTaskReportDivergence(TestTaskReportDivergenceMixin, ERP5TypeTestCase) :
run_all_test = 1
......@@ -184,10 +207,15 @@ class TestTaskReportDivergence(TestTaskReportDivergenceMixin, ERP5TypeTestCase)
stepSetStrictSecurity \
' + self.default_task_sequence + '\
stepCheckTaskReportIsSolved \
stepChangeCommentOnTaskReport \
stepChangeTaskReportStartDate \
stepCheckTaskReportIsCalculating \
stepTic \
stepCheckTaskReportIsDiverged \
stepAcceptDateDecision \
stepTic \
stepCheckTaskReportIsSolved \
stepCheckCommentStillOnTaskReport \
'
sequence_list.addSequenceString(sequence_string)
......
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