Commit 833f6db4 authored by Sebastien Robin's avatar Sebastien Robin

commit last minor changes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11731 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9d631e99
...@@ -78,13 +78,13 @@ resource = request.get(\'resource\',None)\n ...@@ -78,13 +78,13 @@ resource = request.get(\'resource\',None)\n
previous_resource = request.get(\'previous_resource\',None)\n previous_resource = request.get(\'previous_resource\',None)\n
item_model = context.getPortalObject().restrictedTraverse(resource)\n item_model = context.getPortalObject().restrictedTraverse(resource)\n
\n \n
# We muste make sure that the selection is not None\n # We must make sure that the selection is not None\n
# or the validator of the Listbox will not work\n # or the validator of the Listbox will not work\n
from Products.ERP5Form.Selection import Selection\n from Products.ERP5Form.Selection import Selection\n
selection = context.portal_selections.getSelectionFor(\'Check_fastInputForm_selection\')\n selection = context.portal_selections.getSelectionFor(\'Check_fastInputForm_selection\')\n
if selection is None:\n if selection is None:\n
selection = Selection()\n selection = Selection()\n
context.portal_selections.setSelectionFor(\'Check_fastInputForm_selection\',selection)\n context.portal_selections.setSelectionFor(\'Check_fastInputForm_selection\',selection)\n
\n \n
global error_value\n global error_value\n
error_value = 0\n error_value = 0\n
...@@ -119,6 +119,10 @@ else:\n ...@@ -119,6 +119,10 @@ else:\n
reference_range_max = line.get(\'reference_range_max\',None)\n reference_range_max = line.get(\'reference_range_max\',None)\n
check_amount = line.get(\'check_amount\',None)\n check_amount = line.get(\'check_amount\',None)\n
quantity = int(line.get(\'quantity\',0))\n quantity = int(line.get(\'quantity\',0))\n
if item_model.isFixedPrice():\n
if quantity != 1:\n
message = \'You must define one by one in this case\'\n
generate_error(line,\'quantity\',message)\n
if destination_payment_reference not in (None,\'\'):\n if destination_payment_reference not in (None,\'\'):\n
account_list = [x.getObject() for x in\n account_list = [x.getObject() for x in\n
context.portal_catalog(portal_type=\'Bank Account\',\n context.portal_catalog(portal_type=\'Bank Account\',\n
...@@ -141,22 +145,35 @@ else:\n ...@@ -141,22 +145,35 @@ else:\n
if quantity!=1:\n if quantity!=1:\n
message = \'Please set a stop number\'\n message = \'Please set a stop number\'\n
generate_error(line,\'reference_range_max\',message)\n generate_error(line,\'reference_range_max\',message)\n
else:\n #else:\n
reference_range_max = reference_range_min\n #reference_range_max = reference_range_min\n
line[\'reference_range_max\'] = reference_range_max\n #line[\'reference_range_max\'] = reference_range_max\n
if reference_range_min not in (None,\'\') and reference_range_max not in (None,\'\'):\n if reference_range_min not in (None,\'\') and reference_range_max not in (None,\'\'):\n
reference_range_min = int(reference_range_min)\n
reference_range_max = int(reference_range_max)\n
check_quantity = 1\n check_quantity = 1\n
check_reference=1\n
if not item_model.isFixedPrice():\n
try:\n
reference_range_min = int(reference_range_min)\n
except ValueError:\n
message = \'This number is not valid\'\n
generate_error(line,\'reference_range_min\',message)\n
try:\n
reference_range_max = int(reference_range_max)\n
except ValueError:\n
message = \'This number is not valid\'\n
generate_error(line,\'reference_range_max\',message)\n
else:\n
check_reference = 0\n
if check_amount is not None: # In the case of a check book\n if check_amount is not None: # In the case of a check book\n
check_amount_relative_url = \'/\'.join(check_amount.split(\'/\')[1:])\n check_amount_relative_url = \'/\'.join(check_amount.split(\'/\')[1:])\n
line[\'check_amount_relative_url\'] = check_amount_relative_url\n line[\'check_amount_relative_url\'] = check_amount_relative_url\n
check_amount_value = context.getPortalObject().restrictedTraverse(check_amount_relative_url)\n check_amount_value = context.getPortalObject().restrictedTraverse(check_amount_relative_url)\n
check_quantity = int(check_amount_value.getQuantity())\n check_quantity = int(check_amount_value.getQuantity())\n
if (reference_range_max-reference_range_min+1)!=(check_quantity*quantity):\n if check_reference:\n
message = \'The range is not valid\'\n if (reference_range_max-reference_range_min+1)!=(check_quantity*quantity):\n
generate_error(line,\'reference_range_min\',message)\n message = \'The range is not valid\'\n
generate_error(line,\'reference_range_max\',message)\n generate_error(line,\'reference_range_min\',message)\n
generate_error(line,\'reference_range_max\',message)\n
\n \n
if batch_mode:\n if batch_mode:\n
return error_value\n return error_value\n
...@@ -257,17 +274,19 @@ else:\n ...@@ -257,17 +274,19 @@ else:\n
<string>check_amount</string> <string>check_amount</string>
<string>int</string> <string>int</string>
<string>quantity</string> <string>quantity</string>
<string>message</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>x</string> <string>x</string>
<string>account_list</string> <string>account_list</string>
<string>len</string> <string>len</string>
<string>message</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>account</string> <string>account</string>
<string>_write_</string> <string>_write_</string>
<string>destination_trade</string> <string>destination_trade</string>
<string>check_quantity</string> <string>check_quantity</string>
<string>check_reference</string>
<string>ValueError</string>
<string>check_amount_relative_url</string> <string>check_amount_relative_url</string>
<string>check_amount_value</string> <string>check_amount_value</string>
<string>_apply_</string> <string>_apply_</string>
......
...@@ -88,7 +88,8 @@ if item_model.getPortalType()== \'Check Model\':\n ...@@ -88,7 +88,8 @@ if item_model.getPortalType()== \'Check Model\':\n
if len(item_model.getVariationRangeCategoryList())>0:\n if len(item_model.getVariationRangeCategoryList())>0:\n
return_list.append([\'check_type\',\'Check Value\'])\n return_list.append([\'check_type\',\'Check Value\'])\n
return_list.append([\'reference_range_min\',\'Start Number\'])\n return_list.append([\'reference_range_min\',\'Start Number\'])\n
return_list.append([\'reference_range_max\',\'Stop Number\'])\n if not item_model.isFixedPrice():\n
return_list.append([\'reference_range_max\',\'Stop Number\'])\n
\n \n
if item_model.getPortalType()== \'Checkbook Model\':\n if item_model.getPortalType()== \'Checkbook Model\':\n
return_list.append([\'destination_payment_reference\',\'Account Reference\'])\n return_list.append([\'destination_payment_reference\',\'Account Reference\'])\n
......
...@@ -100,12 +100,12 @@ ...@@ -100,12 +100,12 @@
<string>listbox_quantity</string> <string>listbox_quantity</string>
<string>listbox_account_number</string> <string>listbox_account_number</string>
<string>listbox_price</string> <string>listbox_price</string>
<string>listbox_reference_range_max</string>
<string>listbox_reference_range_min</string>
<string>listbox_destination_payment_reference</string> <string>listbox_destination_payment_reference</string>
<string>listbox_check_amount</string> <string>listbox_check_amount</string>
<string>listbox_price_currency</string> <string>listbox_price_currency</string>
<string>listbox_check_type</string> <string>listbox_check_type</string>
<string>listbox_reference_range_max</string>
<string>listbox_reference_range_min</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
<string>Counter</string> <string>Counter</string>
</tuple> </tuple>
<tuple> <tuple>
<string>destination_payment_id</string> <string>destination_payment_reference</string>
<string>Account Number</string> <string>Account Number</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -389,7 +389,7 @@ ...@@ -389,7 +389,7 @@
<string>Counter</string> <string>Counter</string>
</tuple> </tuple>
<tuple> <tuple>
<string>destination_payment_id</string> <string>destination_payment_reference</string>
<string>Account Number</string> <string>Account Number</string>
</tuple> </tuple>
<tuple> <tuple>
......
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<value> <value>
<list> <list>
<string>left</string> <string>left</string>
<string>rigth</string> <string>right</string>
<string>center</string> <string>center</string>
<string>bottom</string> <string>bottom</string>
<string>hidden</string> <string>hidden</string>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>rigth</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_start_date</string> <string>my_start_date</string>
......
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>resource_title</string> <string>getResourceTitle</string>
<string>Resource</string> <string>Resource</string>
</tuple> </tuple>
<tuple> <tuple>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Auteur</string> </value> <value> <string>Actor</string> </value>
</item> </item>
<item> <item>
<key> <string>for_catalog</string> </key> <key> <string>for_catalog</string> </key>
......
...@@ -119,7 +119,8 @@ for line in line_list:\n ...@@ -119,7 +119,8 @@ for line in line_list:\n
else:\n else:\n
item.setReference(reference_range_min)\n item.setReference(reference_range_min)\n
item.setTitle(reference_range_min)\n item.setTitle(reference_range_min)\n
reference_range_min = str(int(float(reference_range_min)) + 1)\n if quantity>1:\n
reference_range_min = str(int(float(reference_range_min)) + 1)\n
if len(resource.objectValues())>0:\n if len(resource.objectValues())>0:\n
item_type = line.getCheckTypeValue()\n item_type = line.getCheckTypeValue()\n
item.setPrice(item_type.getPrice())\n item.setPrice(item_type.getPrice())\n
......
58 61
\ 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