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

lookup the Product instead of creating a new one each time



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11240 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 189d617d
...@@ -131,7 +131,13 @@ def getBankAccountByTitle(title):\n ...@@ -131,7 +131,13 @@ def getBankAccountByTitle(title):\n
\'%d Bank Account with title "%s"\' % (len(document_list), title)\n \'%d Bank Account with title "%s"\' % (len(document_list), title)\n
return document_list[0]\n return document_list[0]\n
\n \n
product = portal.product_module.newContent(portal_type=\'Product\',\n product_list = [o.getObject() for o in portal.portal_catalog(\n
portal_type=\'Product\',\n
title=\'Dummy Product for testing\')]\n
if product_list:\n
product = product_list[0]\n
else:\n
product = portal.product_module.newContent(portal_type=\'Product\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
title=\'Dummy Product for testing\')\n title=\'Dummy Product for testing\')\n
\n \n
...@@ -371,6 +377,8 @@ return "Accounting Transactions Created."\n ...@@ -371,6 +377,8 @@ return "Accounting Transactions Created."\n
<string>getCurrencyByReference</string> <string>getCurrencyByReference</string>
<string>euro_resource</string> <string>euro_resource</string>
<string>getBankAccountByTitle</string> <string>getBankAccountByTitle</string>
<string>o</string>
<string>product_list</string>
<string>product</string> <string>product</string>
<string>range</string> <string>range</string>
<string>random</string> <string>random</string>
......
31 32
\ 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