Commit 11c4eb13 authored by Vincent Pelletier's avatar Vincent Pelletier

Allow user to input stop_date on mutilated banknotes.

Do not use current "finish" transition date as stop date.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19270 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dff55e48
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
<value> <value>
<list> <list>
<string>my_start_date</string> <string>my_start_date</string>
<string>my_stop_date</string>
<string>my_description</string> <string>my_description</string>
</list> </list>
</value> </value>
......
...@@ -69,17 +69,15 @@ ...@@ -69,17 +69,15 @@
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
from DateTime import DateTime\n
\n \n
ob = state_change[\'object\']\n ob = state_change[\'object\']\n
\n \n
today = DateTime().Date()\n stop_date = ob.getStopDate()\n
ob.setStopDate(today)\n ob.Baobab_checkCounterDateOpen(site=ob.getSource(), date=stop_date)\n
ob.Baobab_checkCounterDateOpen(site=ob.getSource(), date=ob.getStopDate())\n
context.Baobab_checkCounterOpened(ob.getSource())\n context.Baobab_checkCounterOpened(ob.getSource())\n
\n \n
for exchanged_line in ob.objectValues(portal_type=\'Exchanged Mutilated Banknote Line\'):\n for exchanged_line in ob.objectValues(portal_type=\'Exchanged Mutilated Banknote Line\'):\n
exchanged_line.setStartDate(today)\n exchanged_line.setStartDate(stop_date)\n
\n \n
if ob.getDestinationTotalAssetPrice() == 0:\n if ob.getDestinationTotalAssetPrice() == 0:\n
msg = Message(domain = "ui", message="Exchanged amount must be defined on document.")\n msg = Message(domain = "ui", message="Exchanged amount must be defined on document.")\n
...@@ -143,11 +141,10 @@ if exchanged_mutilated_banknote_total_price != ob.getDestinationTotalAssetPrice( ...@@ -143,11 +141,10 @@ if exchanged_mutilated_banknote_total_price != ob.getDestinationTotalAssetPrice(
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>Message</string>
<string>DateTime</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>ob</string> <string>ob</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>today</string> <string>stop_date</string>
<string>context</string> <string>context</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>exchanged_line</string> <string>exchanged_line</string>
......
597 598
\ 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