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