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