Commit c320a966 authored by Jérome Perrin's avatar Jérome Perrin

Validate third parties in setup.

Use assertFloatValue where appropriate.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12418 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ffcabd3a
...@@ -270,22 +270,22 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -270,22 +270,22 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
<td>account_module/fixed_assets</td>\n <td>account_module/fixed_assets</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat ! -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>20.0</td> \n <td>20.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat ! -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n
<td>0.0</td> \n <td>0.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n
<td>20.0</td>\n <td>20.0</td>\n
</tr>\n </tr>\n
......
...@@ -168,12 +168,12 @@ Test Simple view of an Accounting Transaction\n ...@@ -168,12 +168,12 @@ Test Simple view of an Accounting Transaction\n
<td>account_module/stocks</td>\n <td>account_module/stocks</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>10.0</td>\n <td>10.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n
<td>20.0</td>\n <td>20.0</td>\n
</tr>\n </tr>\n
...@@ -212,13 +212,12 @@ Test Simple view of an Accounting Transaction\n ...@@ -212,13 +212,12 @@ Test Simple view of an Accounting Transaction\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n
<td>0.0</td> <!-- FIXME: precision is wrong, but assertFloat doesn\'t work for\n <td>0.0</td>\n
values -->\n
</tr> \n </tr> \n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr> \n </tr> \n
...@@ -251,12 +250,12 @@ Test Simple view of an Accounting Transaction\n ...@@ -251,12 +250,12 @@ Test Simple view of an Accounting Transaction\n
<td>account_module/stocks</td>\n <td>account_module/stocks</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>10.0</td>\n <td>10.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n
<td>20.0</td>\n <td>20.0</td>\n
</tr>\n </tr>\n
......
...@@ -297,32 +297,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -297,32 +297,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
<td>account_module/goods_purchase</td>\n <td>account_module/goods_purchase</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat ! -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>10.0</td> \n <td>10.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat ! -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n
<td>0.0</td> \n <td>0.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n
<td>1.0</td>\n <td>1.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n
<td>11.0</td>\n <td>11.0</td>\n
</tr>\n </tr>\n
......
...@@ -299,32 +299,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -299,32 +299,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
<td>account_module/goods_sales</td>\n <td>account_module/goods_sales</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat ! -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>0.0</td> \n <td>0.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat ! -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n
<td>10.0</td> \n <td>10.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n
<td>1.0</td>\n <td>1.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n
<td>11.0</td>\n <td>11.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td> <!-- XXX use assertFloat -->\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
......
...@@ -75,7 +75,7 @@ Test jumps from Accounting Transaction Module\n ...@@ -75,7 +75,7 @@ Test jumps from Accounting Transaction Module\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertTitle</td>\n <td>assertTitle</td>\n
<td>Transactions - Client 1</td>\n <td>Transactions - Client 1*</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
...@@ -97,7 +97,7 @@ Test jumps from Accounting Transaction Module\n ...@@ -97,7 +97,7 @@ Test jumps from Accounting Transaction Module\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertTitle</td>\n <td>assertTitle</td>\n
<td>Transactions - Supplier</td>\n <td>Transactions - Supplier*</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
......
...@@ -71,16 +71,28 @@ ...@@ -71,16 +71,28 @@
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
\n \n
# open all accounts\n # open all accounts\n
[ account.validate() for account in portal.account_module.objectValues()\n for account in portal.account_module.objectValues():\n
if account.getValidationState() != \'validated\' ]\n if account.getValidationState() != \'validated\':\n
account.validate()\n
\n
# validate third parties and set them a dummy region, because it\'s required\n
for entity in ( portal.organisation_module.objectValues() +\n
portal.person_module.objectValues() ):\n
if entity.getValidationState() != \'validated\':\n
entity.setRegion(\'region\')\n
entity.validate()\n
\n
# create accounting periods ?\n
# XXX\n
\n \n
# enable preference\n # enable preference\n
pref = portal.portal_preferences.accounting_zuite_preference\n pref = portal.portal_preferences.accounting_zuite_preference\n
if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n
# we have to \'own\' the preference for the test\n # we have to \'own\' the preference for the test\n
ptool = portal.portal_preferences\n ptool = portal.portal_preferences\n
pref.setId(\'old_accounting_zuite_preference\')\n # pref.setId(\'old_accounting_zuite_preference\')\n
cb = ptool.manage_copyObjects([\'old_accounting_zuite_preference\'])\n cb = ptool.manage_copyObjects([\'accounting_zuite_preference\'])\n
# FIXME: how could this work ???\n
ptool.manage_pasteObjects(cb)\n ptool.manage_pasteObjects(cb)\n
# as the preference changed, it\'s safer to clear the cache\n # as the preference changed, it\'s safer to clear the cache\n
from Products.ERP5Type.Cache import clearCache\n from Products.ERP5Type.Cache import clearCache\n
...@@ -151,10 +163,9 @@ return "Reset Successfully."\n ...@@ -151,10 +163,9 @@ return "Reset Successfully."\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>account</string> <string>account</string>
<string>entity</string>
<string>pref</string> <string>pref</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>str</string> <string>str</string>
......
34 35
\ 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