Commit 6e5b4306 authored by Sebastien Robin's avatar Sebastien Robin

a few bug fixes in the user interface of traveler check sale/purchase

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11208 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a00b37e6
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list> <list>
<string>my_simulation_state</string> <string>my_translated_simulation_state</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_simulation_state</string> </value> <value> <string>my_translated_simulation_state</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -69,8 +69,7 @@ ...@@ -69,8 +69,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>filter_dict = {}\n <value> <string>filter_dict = {}\n
filter_dict[\'account_number_enabled\']=0\n filter_dict[\'fixed_price\']=1\n
filter_dict[\'quantity_required\']=0\n
return context.Delivery_viewCheckbookInputDialog(item_portal_type_list=(\'Check\',),model_filter_dict=filter_dict,**kw)\n return context.Delivery_viewCheckbookInputDialog(item_portal_type_list=(\'Check\',),model_filter_dict=filter_dict,**kw)\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -95,41 +95,47 @@ if listbox is None:\n ...@@ -95,41 +95,47 @@ if listbox is None:\n
reference_date = DateTime()\n reference_date = DateTime()\n
item_list = []\n item_list = []\n
listbox = []\n listbox = []\n
getCurrentTrackingList = context.portal_simulation.getCurrentTrackingList\n if node is not None or disable_node:\n
#context.log(\'current_tracking_list src\',getCurrentTrackingList(at_date=reference_date, node=node,src__=1,where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'"))\n getCurrentTrackingList = context.portal_simulation.getCurrentTrackingList\n
#return [x.path for x in getCurrentTrackingList(at_date=reference_date, node=node)]\n #context.log(\'current_tracking_list src\',getCurrentTrackingList(at_date=reference_date, node=node,src__=1,where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'"))\n
current_tracking_list = [x.getObject() for x in getCurrentTrackingList(\n #return [x.path for x in getCurrentTrackingList(at_date=reference_date, node=node)]\n
at_date=reference_date, node=node,\n if disable_node:\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n node=None\n
for item in current_tracking_list:\n current_tracking_list = [x.getObject() for x in getCurrentTrackingList(\n
exclude=0\n at_date=reference_date, node=node,\n
if model_filter_dict is not None:\n where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n
resource = item.getResourceValue()\n for item in current_tracking_list:\n
for property,value in model_filter_dict.items():\n exclude=0\n
if resource.getProperty(property)!=value:\n if model_filter_dict is not None:\n
resource = item.getResourceValue()\n
for property,value in model_filter_dict.items():\n
if resource.getProperty(property)!=value:\n
exclude=1\n
if destination_payment is not None:\n
if destination_payment!=item.getDestinationPayment():\n
exclude=1\n exclude=1\n
if destination_payment is not None:\n if not exclude:\n
if destination_payment!=item.getDestinationPayment():\n item_portal_type = item.getPortalType()\n
exclude=1\n if item_portal_type in item_portal_type_list:\n
if not exclude:\n if item_portal_type==\'Check\' and item.getSimulationState() not in (\'draft\',\'confirmed\'):\n
item_portal_type = item.getPortalType()\n continue\n
if item_portal_type in item_portal_type_list:\n if simulation_state is not None:\n
if item_portal_type==\'Check\' and item.getSimulationState() not in (\'draft\',\'confirmed\'):\n if item.getSimulationState()!=simulation_state:\n
continue\n continue\n
item_dict = {}\n item_dict = {}\n
if item_portal_type==\'Check\':\n if item_portal_type==\'Check\':\n
item_dict[\'reference_range_max\'] = item.getReference()\n item_dict[\'reference_range_max\'] = item.getReference()\n
item_dict[\'reference_range_min\'] = item.getReference()\n item_dict[\'reference_range_min\'] = item.getReference()\n
else:\n else:\n
item_dict[\'reference_range_min\'] = item.getReferenceRangeMin()\n item_dict[\'reference_range_min\'] = item.getReferenceRangeMin()\n
item_dict[\'reference_range_max\'] = item.getReferenceRangeMax()\n item_dict[\'reference_range_max\'] = item.getReferenceRangeMax()\n
item_dict[\'resource_title\'] = item.getResourceTitle()\n item_dict[\'resource_title\'] = item.getResourceTitle()\n
item_dict[\'destination_trade\'] = item.getDestinationTradeTitle()\n item_dict[\'destination_trade\'] = item.getDestinationTradeTitle()\n
item_dict[\'check_amount_title\'] = item.getCheckAmountTitle()\n item_dict[\'check_amount_title\'] = item.getCheckAmountTitle()\n
item_dict[\'selection\'] = 0\n item_dict[\'selection\'] = 0\n
item_dict[\'uid\'] = \'new_%s\' %(item.getUid(),)\n item_dict[\'uid\'] = \'new_%s\' %(item.getUid(),)\n
\n \n
listbox.append(item_dict)\n listbox.append(item_dict)\n
\n \n
if batch_mode:\n if batch_mode:\n
return listbox\n return listbox\n
...@@ -166,7 +172,7 @@ return context.asContext(context=None\n ...@@ -166,7 +172,7 @@ return context.asContext(context=None\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>listbox=None, item_portal_type_list=None,destination_payment=None,model_filter_dict=None,batch_mode=0,**kw</string> </value> <value> <string>listbox=None, item_portal_type_list=None,destination_payment=None,model_filter_dict=None,batch_mode=0,simulation_state=None,disable_node=0,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -186,7 +192,7 @@ return context.asContext(context=None\n ...@@ -186,7 +192,7 @@ return context.asContext(context=None\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>5</int> </value> <value> <int>7</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -197,6 +203,8 @@ return context.asContext(context=None\n ...@@ -197,6 +203,8 @@ return context.asContext(context=None\n
<string>destination_payment</string> <string>destination_payment</string>
<string>model_filter_dict</string> <string>model_filter_dict</string>
<string>batch_mode</string> <string>batch_mode</string>
<string>simulation_state</string>
<string>disable_node</string>
<string>kw</string> <string>kw</string>
<string>DateTime</string> <string>DateTime</string>
<string>Dummy</string> <string>Dummy</string>
...@@ -240,6 +248,8 @@ return context.asContext(context=None\n ...@@ -240,6 +248,8 @@ return context.asContext(context=None\n
<none/> <none/>
<none/> <none/>
<int>0</int> <int>0</int>
<none/>
<int>0</int>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -68,8 +68,10 @@ ...@@ -68,8 +68,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>account = context.getDestinationPayment()\n <value> <string>filter_dict = {}\n
return context.Delivery_viewCheckbookInputDialog(destination_payment=account,**kw)\n filter_dict[\'fixed_price\']=1\n
kw[\'disable_node\'] = 1\n
return context.Delivery_viewCheckbookInputDialog(model_filter_dict=filter_dict,simulation_state=\'confirmed\',**kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -125,10 +127,11 @@ return context.Delivery_viewCheckbookInputDialog(destination_payment=account,**k ...@@ -125,10 +127,11 @@ return context.Delivery_viewCheckbookInputDialog(destination_payment=account,**k
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>filter_dict</string>
<string>_write_</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>account</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -68,8 +68,9 @@ ...@@ -68,8 +68,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>account = context.getDestinationPayment()\n <value> <string>filter_dict = {}\n
return context.Delivery_viewCheckbookInputDialog(**kw)\n filter_dict[\'fixed_price\']=1\n
return context.Delivery_viewCheckbookInputDialog(model_filter_dict=filter_dict,**kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -125,10 +126,11 @@ return context.Delivery_viewCheckbookInputDialog(**kw)\n ...@@ -125,10 +126,11 @@ return context.Delivery_viewCheckbookInputDialog(**kw)\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>filter_dict</string>
<string>_write_</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>account</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -127,9 +127,10 @@ for line in line_list:\n ...@@ -127,9 +127,10 @@ for line in line_list:\n
item.setDestinationPayment(line.getDestinationPayment())\n item.setDestinationPayment(line.getDestinationPayment())\n
item.setDestinationTrade(line.getDestinationTrade())\n item.setDestinationTrade(line.getDestinationTrade())\n
item.setResourceValue(resource)\n item.setResourceValue(resource)\n
if item.getPortalType()==\'Check\':\n # I (seb) think this is a big mistake\n
portal.portal_workflow.doActionFor(item,\'confirm_action\',\n #if item.getPortalType()==\'Check\':\n
wf_id=\'check_workflow\')\n # portal.portal_workflow.doActionFor(item,\'confirm_action\',\n
# wf_id=\'check_workflow\')\n
aggregate_list.append(item)\n aggregate_list.append(item)\n
\n \n
# Finally set the aggregate list on the line\n # Finally set the aggregate list on the line\n
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string></string> </value> <value> <string>validateCheckbookVaultTransferConsistency</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -102,6 +102,9 @@ for movement in movement_list:\n ...@@ -102,6 +102,9 @@ for movement in movement_list:\n
aggregate_value_list = movement.getAggregateValueList()\n aggregate_value_list = movement.getAggregateValueList()\n
for item in aggregate_value_list:\n for item in aggregate_value_list:\n
if item.getPortalType()==\'Check\':\n if item.getPortalType()==\'Check\':\n
if item.getSimulationState()!=\'confirmed\':\n
msg = Message(domain = "ui", message="Sorry, one traveler check was not sale yet")\n
raise ValidationFailed, (msg,)\n
if item.getPrice() is not None:\n if item.getPrice() is not None:\n
# then we must calculate the exchange value at the\n # then we must calculate the exchange value at the\n
# time where the item was first delivered\n # time where the item was first delivered\n
......
...@@ -119,6 +119,11 @@ if total_debit>0:\n ...@@ -119,6 +119,11 @@ if total_debit>0:\n
\n \n
line = transaction.movement\n line = transaction.movement\n
bank_account = transaction.getDestinationPaymentValue()\n bank_account = transaction.getDestinationPaymentValue()\n
\n
if bank_account is None:\n
msg = Message(domain=\'ui\', message="Sorry, no account defined.")\n
raise ValidationFailed, (msg,)\n
\n
price = total_debit\n price = total_debit\n
\n \n
# this prevents multiple transactions from being committed at the same time for this bank account.\n # this prevents multiple transactions from being committed at the same time for this bank account.\n
......
46 48
\ 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