Commit 8bb29446 authored by Jérome Perrin's avatar Jérome Perrin

stop passing immediate_reindex to newContent

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33811 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 74842d09
...@@ -62,7 +62,6 @@ portal = context.getPortalObject()\n ...@@ -62,7 +62,6 @@ portal = context.getPortalObject()\n
accounting_module = portal.accounting_module\n accounting_module = portal.accounting_module\n
year = 2005\n year = 2005\n
default_date = DateTime(year, 01, 01)\n default_date = DateTime(year, 01, 01)\n
immediate_reindex = 0\n
\n \n
# if the previous test didn\'t change input data, no need to recreate content\n # if the previous test didn\'t change input data, no need to recreate content\n
current_script_data_id = \'%s_month_count_%s_draft_%s_state_%s_payment_%s\' % (\n current_script_data_id = \'%s_month_count_%s_draft_%s_state_%s_payment_%s\' % (\n
...@@ -124,12 +123,10 @@ if product_list:\n ...@@ -124,12 +123,10 @@ if product_list:\n
product = product_list[0]\n product = product_list[0]\n
else:\n else:\n
product = portal.product_module.newContent(portal_type=\'Product\',\n product = portal.product_module.newContent(portal_type=\'Product\',\n
immediate_reindex=immediate_reindex,\n
title=\'Dummy Product for testing\')\n title=\'Dummy Product for testing\')\n
\n \n
for i in range(random.randint(5, 10)):\n for i in range(random.randint(5, 10)):\n
pl = portal.sale_packing_list_module.newContent(\n pl = portal.sale_packing_list_module.newContent(\n
immediate_reindex=immediate_reindex,\n
portal_type=\'Sale Packing List\',\n portal_type=\'Sale Packing List\',\n
title=\'Dummy Packing List for testing\',\n title=\'Dummy Packing List for testing\',\n
source_section=section,\n source_section=section,\n
...@@ -138,7 +135,6 @@ for i in range(random.randint(5, 10)):\n ...@@ -138,7 +135,6 @@ for i in range(random.randint(5, 10)):\n
destination=getOrganisationByTitle(\'Client 1\'),\n destination=getOrganisationByTitle(\'Client 1\'),\n
start_date=default_date, )\n start_date=default_date, )\n
line = pl.newContent(portal_type=\'Sale Packing List Line\',\n line = pl.newContent(portal_type=\'Sale Packing List Line\',\n
immediate_reindex=immediate_reindex,\n
resource_value=product,\n resource_value=product,\n
quantity=random.randint(300, 500),\n quantity=random.randint(300, 500),\n
price=random.randint(300, 500))\n price=random.randint(300, 500))\n
...@@ -151,7 +147,6 @@ for i in range(random.randint(5, 10)):\n ...@@ -151,7 +147,6 @@ for i in range(random.randint(5, 10)):\n
for month in range(1, month_count + 1):\n for month in range(1, month_count + 1):\n
default_date = DateTime(year, month, 1)\n default_date = DateTime(year, month, 1)\n
tr = accounting_module.newContent(\n tr = accounting_module.newContent(\n
immediate_reindex=immediate_reindex,\n
title=\'Accounts opening\',\n title=\'Accounts opening\',\n
portal_type=\'Accounting Transaction\',\n portal_type=\'Accounting Transaction\',\n
source_section=section,\n source_section=section,\n
...@@ -162,15 +157,12 @@ for month in range(1, month_count + 1):\n ...@@ -162,15 +157,12 @@ for month in range(1, month_count + 1):\n
)\n )\n
\n \n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Equity\'),\n source=getAccountByTitle(\'Equity\'),\n
quantity=20000)\n quantity=20000)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Fixed Assets\'),\n source=getAccountByTitle(\'Fixed Assets\'),\n
quantity=-15000)\n quantity=-15000)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Stocks\'),\n source=getAccountByTitle(\'Stocks\'),\n
quantity=-5000)\n quantity=-5000)\n
# TODO: "validated" should be renamed to "stopped"\n # TODO: "validated" should be renamed to "stopped"\n
...@@ -190,7 +182,6 @@ for month in range(1, month_count + 1):\n ...@@ -190,7 +182,6 @@ for month in range(1, month_count + 1):\n
for client_title, amount in ((\'Client 1\', 2000), (\'Client 2\', 3000)):\n for client_title, amount in ((\'Client 1\', 2000), (\'Client 2\', 3000)):\n
default_date += 1\n default_date += 1\n
tr = accounting_module.newContent(\n tr = accounting_module.newContent(\n
immediate_reindex=immediate_reindex,\n
portal_type=\'Sale Invoice Transaction\',\n portal_type=\'Sale Invoice Transaction\',\n
title=\'%s Sale Invoice\' % client_title,\n title=\'%s Sale Invoice\' % client_title,\n
source_section=section,\n source_section=section,\n
...@@ -203,20 +194,16 @@ for month in range(1, month_count + 1):\n ...@@ -203,20 +194,16 @@ for month in range(1, month_count + 1):\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=-(amount * (1 + vat_rate)))\n quantity=-(amount * (1 + vat_rate)))\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
quantity=amount * vat_rate)\n quantity=amount * vat_rate)\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
quantity=amount)\n quantity=amount)\n
# add a random invoice line, which should not impact our tests\n # add a random invoice line, which should not impact our tests\n
tr.newContent(portal_type=\'Invoice Line\',\n tr.newContent(portal_type=\'Invoice Line\',\n
immediate_reindex=immediate_reindex,\n
source=section,\n source=section,\n
destination=getOrganisationByTitle(client_title),\n destination=getOrganisationByTitle(client_title),\n
resource_value=product,\n resource_value=product,\n
...@@ -235,7 +222,6 @@ for month in range(1, month_count + 1):\n ...@@ -235,7 +222,6 @@ for month in range(1, month_count + 1):\n
if add_related_payments:\n if add_related_payments:\n
payment = accounting_module.newContent(\n payment = accounting_module.newContent(\n
causality_value=tr,\n causality_value=tr,\n
immediate_reindex=immediate_reindex,\n
portal_type=\'Payment Transaction\',\n portal_type=\'Payment Transaction\',\n
title=\'%s Payment\' % client_title,\n title=\'%s Payment\' % client_title,\n
source_section=section,\n source_section=section,\n
...@@ -246,11 +232,9 @@ for month in range(1, month_count + 1):\n ...@@ -246,11 +232,9 @@ for month in range(1, month_count + 1):\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
payment.newContent(portal_type=\'Accounting Transaction Line\',\n payment.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Bank\'),\n source=getAccountByTitle(\'Bank\'),\n
quantity=-(amount * (1 + vat_rate)))\n quantity=-(amount * (1 + vat_rate)))\n
payment.newContent(portal_type=\'Accounting Transaction Line\',\n payment.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=(amount * (1 + vat_rate)))\n quantity=(amount * (1 + vat_rate)))\n
if transaction_state in (\'validated\', \'delivered\'):\n if transaction_state in (\'validated\', \'delivered\'):\n
...@@ -276,7 +260,6 @@ for month in range(1, month_count + 1):\n ...@@ -276,7 +260,6 @@ for month in range(1, month_count + 1):\n
amount=7000\n amount=7000\n
default_date += 1\n default_date += 1\n
tr = accounting_module.newContent(\n tr = accounting_module.newContent(\n
immediate_reindex=immediate_reindex,\n
portal_type=\'Purchase Invoice Transaction\',\n portal_type=\'Purchase Invoice Transaction\',\n
title=\'First Purchase Invoice\',\n title=\'First Purchase Invoice\',\n
destination_section=section,\n destination_section=section,\n
...@@ -287,15 +270,12 @@ for month in range(1, month_count + 1):\n ...@@ -287,15 +270,12 @@ for month in range(1, month_count + 1):\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
destination=getAccountByTitle(\'Payable\'),\n destination=getAccountByTitle(\'Payable\'),\n
quantity=-(amount * (1 + vat_rate)))\n quantity=-(amount * (1 + vat_rate)))\n
tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
destination=getAccountByTitle(\'Refundable VAT 10%\'),\n destination=getAccountByTitle(\'Refundable VAT 10%\'),\n
quantity=amount * vat_rate)\n quantity=amount * vat_rate)\n
tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
destination=getAccountByTitle(\'Goods Purchase\'),\n destination=getAccountByTitle(\'Goods Purchase\'),\n
quantity=amount)\n quantity=amount)\n
if transaction_state == \'validated\':\n if transaction_state == \'validated\':\n
...@@ -314,7 +294,6 @@ if add_draft_transactions:\n ...@@ -314,7 +294,6 @@ if add_draft_transactions:\n
# impact on the test\n # impact on the test\n
for client_title, amount in ((\'Client 1\', 2000), (\'Client 2\', 3000)):\n for client_title, amount in ((\'Client 1\', 2000), (\'Client 2\', 3000)):\n
tr = accounting_module.newContent(\n tr = accounting_module.newContent(\n
immediate_reindex=immediate_reindex,\n
portal_type=\'Sale Invoice Transaction\',\n portal_type=\'Sale Invoice Transaction\',\n
title=\'%s Sale Invoice\' % client_title,\n title=\'%s Sale Invoice\' % client_title,\n
source_section=section,\n source_section=section,\n
...@@ -326,16 +305,13 @@ if add_draft_transactions:\n ...@@ -326,16 +305,13 @@ if add_draft_transactions:\n
)\n )\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=random.randint(300, 400),\n quantity=random.randint(300, 400),)\n
immediate_reindex=immediate_reindex)\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
quantity=random.randint(300, 400),\n quantity=random.randint(300, 400),)\n
immediate_reindex=immediate_reindex)\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
quantity=random.randint(300, 400),\n quantity=random.randint(300, 400),)\n
immediate_reindex=immediate_reindex)\n
\n \n
accounting_module.setProperty(\'current_content_script\',\n accounting_module.setProperty(\'current_content_script\',\n
current_script_data_id)\n current_script_data_id)\n
...@@ -392,7 +368,6 @@ return "Accounting Transactions Created."\n ...@@ -392,7 +368,6 @@ return "Accounting Transactions Created."\n
<string>accounting_module</string> <string>accounting_module</string>
<string>year</string> <string>year</string>
<string>default_date</string> <string>default_date</string>
<string>immediate_reindex</string>
<string>script</string> <string>script</string>
<string>current_script_data_id</string> <string>current_script_data_id</string>
<string>_getiter_</string> <string>_getiter_</string>
......
...@@ -62,7 +62,6 @@ section_title = \'My Organisation\'\n ...@@ -62,7 +62,6 @@ section_title = \'My Organisation\'\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
accounting_module = portal.accounting_module\n accounting_module = portal.accounting_module\n
year = 2005\n year = 2005\n
immediate_reindex = 0\n
\n \n
total_receivable_quantity = 0\n total_receivable_quantity = 0\n
\n \n
...@@ -128,7 +127,6 @@ for month in range(1, month_count + 1):\n ...@@ -128,7 +127,6 @@ for month in range(1, month_count + 1):\n
start_date=DateTime(year, month, day),\n start_date=DateTime(year, month, day),\n
stop_date=DateTime(year, month, day),\n stop_date=DateTime(year, month, day),\n
resource=euro_resource,\n resource=euro_resource,\n
immediate_reindex=immediate_reindex,\n
)\n )\n
receivable_qty = -(amount * (1 + vat_rate))\n receivable_qty = -(amount * (1 + vat_rate))\n
total_receivable_quantity += receivable_qty\n total_receivable_quantity += receivable_qty\n
...@@ -136,19 +134,16 @@ for month in range(1, month_count + 1):\n ...@@ -136,19 +134,16 @@ for month in range(1, month_count + 1):\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
destination=getAccountByTitle(\'Payable\'),\n destination=getAccountByTitle(\'Payable\'),\n
quantity=receivable_qty,\n quantity=receivable_qty,\n
immediate_reindex=immediate_reindex,\n
)\n )\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
destination=getAccountByTitle(\'Refundable VAT 10%\'),\n destination=getAccountByTitle(\'Refundable VAT 10%\'),\n
quantity=amount * vat_rate,\n quantity=amount * vat_rate,\n
immediate_reindex=immediate_reindex,\n
)\n )\n
tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
destination=getAccountByTitle(\'Goods Purchase\'),\n destination=getAccountByTitle(\'Goods Purchase\'),\n
quantity=amount,\n quantity=amount,\n
immediate_reindex=immediate_reindex,\n
)\n )\n
tr.stop()\n tr.stop()\n
\n \n
...@@ -164,18 +159,15 @@ for month in range(1, month_count + 1):\n ...@@ -164,18 +159,15 @@ for month in range(1, month_count + 1):\n
stop_date=DateTime(year, month, day, 01, 01) + 10,\n stop_date=DateTime(year, month, day, 01, 01) + 10,\n
causality_value=tr,\n causality_value=tr,\n
resource=euro_resource,\n resource=euro_resource,\n
immediate_reindex=immediate_reindex,\n
)\n )\n
\n \n
ptr.newContent(portal_type=\'Accounting Transaction Line\',\n ptr.newContent(portal_type=\'Accounting Transaction Line\',\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=(amount * (1 + vat_rate)),\n quantity=(amount * (1 + vat_rate)),\n
immediate_reindex=immediate_reindex,\n
)\n )\n
ptr.newContent(portal_type=\'Accounting Transaction Line\',\n ptr.newContent(portal_type=\'Accounting Transaction Line\',\n
source=getAccountByTitle(\'Bank\'),\n source=getAccountByTitle(\'Bank\'),\n
quantity= - (amount * (1 + vat_rate)),\n quantity= - (amount * (1 + vat_rate)),\n
immediate_reindex=immediate_reindex,\n
)\n )\n
ptr.stop()\n ptr.stop()\n
\n \n
...@@ -243,7 +235,6 @@ return "Accounting Transactions Created."\n ...@@ -243,7 +235,6 @@ return "Accounting Transactions Created."\n
<string>portal</string> <string>portal</string>
<string>accounting_module</string> <string>accounting_module</string>
<string>year</string> <string>year</string>
<string>immediate_reindex</string>
<string>total_receivable_quantity</string> <string>total_receivable_quantity</string>
<string>script</string> <string>script</string>
<string>current_script_data_id</string> <string>current_script_data_id</string>
......
145 146
\ 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