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
previous_resource = request.get(\'previous_resource\',None)\n
item_model = context.getPortalObject().restrictedTraverse(resource)\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
from Products.ERP5Form.Selection import Selection\n
selection = context.portal_selections.getSelectionFor(\'Check_fastInputForm_selection\')\n
if selection is None:\n
selection = Selection()\n
context.portal_selections.setSelectionFor(\'Check_fastInputForm_selection\',selection)\n
context.portal_selections.setSelectionFor(\'Check_fastInputForm_selection\',selection)\n
\n
global error_value\n
error_value = 0\n
......@@ -119,6 +119,10 @@ else:\n
reference_range_max = line.get(\'reference_range_max\',None)\n
check_amount = line.get(\'check_amount\',None)\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
account_list = [x.getObject() for x in\n
context.portal_catalog(portal_type=\'Bank Account\',\n
......@@ -141,18 +145,31 @@ else:\n
if quantity!=1:\n
message = \'Please set a stop number\'\n
generate_error(line,\'reference_range_max\',message)\n
else:\n
reference_range_max = reference_range_min\n
line[\'reference_range_max\'] = reference_range_max\n
#else:\n
#reference_range_max = reference_range_min\n
#line[\'reference_range_max\'] = reference_range_max\n
if reference_range_min not in (None,\'\') and reference_range_max not in (None,\'\'):\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
check_quantity = 1\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
check_amount_relative_url = \'/\'.join(check_amount.split(\'/\')[1:])\n
line[\'check_amount_relative_url\'] = check_amount_relative_url\n
check_amount_value = context.getPortalObject().restrictedTraverse(check_amount_relative_url)\n
check_quantity = int(check_amount_value.getQuantity())\n
if check_reference:\n
if (reference_range_max-reference_range_min+1)!=(check_quantity*quantity):\n
message = \'The range is not valid\'\n
generate_error(line,\'reference_range_min\',message)\n
......@@ -257,17 +274,19 @@ else:\n
<string>check_amount</string>
<string>int</string>
<string>quantity</string>
<string>message</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>account_list</string>
<string>len</string>
<string>message</string>
<string>_getitem_</string>
<string>account</string>
<string>_write_</string>
<string>destination_trade</string>
<string>check_quantity</string>
<string>check_reference</string>
<string>ValueError</string>
<string>check_amount_relative_url</string>
<string>check_amount_value</string>
<string>_apply_</string>
......
......@@ -88,6 +88,7 @@ if item_model.getPortalType()== \'Check Model\':\n
if len(item_model.getVariationRangeCategoryList())>0:\n
return_list.append([\'check_type\',\'Check Value\'])\n
return_list.append([\'reference_range_min\',\'Start Number\'])\n
if not item_model.isFixedPrice():\n
return_list.append([\'reference_range_max\',\'Stop Number\'])\n
\n
if item_model.getPortalType()== \'Checkbook Model\':\n
......
......@@ -100,12 +100,12 @@
<string>listbox_quantity</string>
<string>listbox_account_number</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_check_amount</string>
<string>listbox_price_currency</string>
<string>listbox_check_type</string>
<string>listbox_reference_range_max</string>
<string>listbox_reference_range_min</string>
</list>
</value>
</item>
......
......@@ -336,7 +336,7 @@
<string>Counter</string>
</tuple>
<tuple>
<string>destination_payment_id</string>
<string>destination_payment_reference</string>
<string>Account Number</string>
</tuple>
<tuple>
......@@ -389,7 +389,7 @@
<string>Counter</string>
</tuple>
<tuple>
<string>destination_payment_id</string>
<string>destination_payment_reference</string>
<string>Account Number</string>
</tuple>
<tuple>
......
......@@ -265,7 +265,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -68,7 +68,7 @@
<value>
<list>
<string>left</string>
<string>rigth</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
......@@ -113,7 +113,7 @@
</value>
</item>
<item>
<key> <string>rigth</string> </key>
<key> <string>right</string> </key>
<value>
<list>
<string>my_start_date</string>
......
......@@ -330,7 +330,7 @@
<value>
<list>
<tuple>
<string>resource_title</string>
<string>getResourceTitle</string>
<string>Resource</string>
</tuple>
<tuple>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -36,7 +36,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Auteur</string> </value>
<value> <string>Actor</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
......
......@@ -119,6 +119,7 @@ for line in line_list:\n
else:\n
item.setReference(reference_range_min)\n
item.setTitle(reference_range_min)\n
if quantity>1:\n
reference_range_min = str(int(float(reference_range_min)) + 1)\n
if len(resource.objectValues())>0:\n
item_type = line.getCheckTypeValue()\n
......
58
\ No newline at end of file
61
\ 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