Commit b8090d8c authored by Vincent Pelletier's avatar Vincent Pelletier

Only update the stop date if we are on "started" state (the same script is...

Only update the stop date if we are on "started" state (the same script is called to go to delivered).
Fix a stupid mistake when checking if stop_date was given.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24972 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8ebe18d2
......@@ -97,11 +97,12 @@ for movement in movement_list:\n
raise ValidationFailed, (msg,)\n
debit_required = transaction.isDebitRequired()\n
if debit_required:\n
stop_date = state_change.kwargs.get(\'stop_date\')\n
if \'stop_date\' is None:\n
msg = Message(domain = "ui", message="No stop date provided")\n
raise ValidationFailed, (msg,)\n
transaction.setStopDate(stop_date)\n
if transaction.getSimulationState() == \'started\':\n
stop_date = state_change.kwargs.get(\'stop_date\')\n
if stop_date is None:\n
msg = Message(domain = "ui", message="No stop date provided")\n
raise ValidationFailed, (msg,)\n
transaction.setStopDate(stop_date)\n
\n
# Source and destination will be updated automaticaly based on the category of bank account\n
# The default account chosen should act as some kind of *temp* account or *parent* account\n
......
415
\ No newline at end of file
416
\ No newline at end of file
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