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

add an new parameter to keep automatically generated grouping reference, and...

add an new parameter to keep automatically generated grouping reference, and set it to false for compatibility with previous behaviour

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23222 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2849d3a
......@@ -258,9 +258,19 @@ for month in range(1, month_count + 1):\n
if transaction_state == \'validated\':\n
payment.stop()\n
assert payment.getSimulationState() == \'stopped\'\n
if not keep_grouping_reference:\n
for line in payment.getMovementList(\n
portal_type=payment.getPortalAccountingMovementTypeList()):\n
if line.getGroupingReference():\n
line.activate(after_path_and_method_id=(\n
(payment.getPath(), (\'recursiveImmediateReindexObject\', \'immediateReindexObject\')),\n
(line.getPath(), (\'recursiveImmediateReindexObject\', \'immediateReindexObject\')),),\n
).AccountingTransactionLine_resetGroupingReference()\n
\n
else:\n
# other cases not supported for now\n
assert transaction_state == \'draft\'\n
\n
\n
amount=7000\n
default_date += 1\n
......@@ -344,7 +354,7 @@ return "Accounting Transactions Created."\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>month_count=1, add_draft_transactions=1, transaction_state=\'validated\', add_related_payments=0</string> </value>
<value> <string>month_count=1, add_draft_transactions=1, transaction_state=\'validated\', add_related_payments=0, keep_grouping_reference=0</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -364,7 +374,7 @@ return "Accounting Transactions Created."\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>4</int> </value>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -374,6 +384,7 @@ return "Accounting Transactions Created."\n
<string>add_draft_transactions</string>
<string>transaction_state</string>
<string>add_related_payments</string>
<string>keep_grouping_reference</string>
<string>DateTime</string>
<string>section_title</string>
<string>_getattr_</string>
......@@ -430,6 +441,7 @@ return "Accounting Transactions Created."\n
<int>1</int>
<string>validated</string>
<int>0</int>
<int>0</int>
</tuple>
</value>
</item>
......
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -194,6 +191,16 @@ for month in range(1, month_count + 1):\n
immediate_reindex=immediate_reindex,\n
)\n
ptr.stop()\n
\n
if not keep_grouping_reference:\n
for line in ptr.getMovementList(\n
portal_type=ptr.getPortalAccountingMovementTypeList()):\n
if line.getGroupingReference():\n
line.activate(after_path_and_method_id=(\n
(ptr.getPath(), (\'recursiveImmediateReindexObject\', \'immediateReindexObject\')),\n
(line.getPath(), (\'recursiveImmediateReindexObject\', \'immediateReindexObject\')),),\n
).AccountingTransactionLine_resetGroupingReference()\n
\n
\n
accounting_module.setProperty(\'current_content_script\',\n
current_script_data_id)\n
......@@ -225,7 +232,7 @@ return "Accounting Transactions Created."\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>month_count=1, no_creation_need=0</string> </value>
<value> <string>month_count=1, no_creation_need=0, keep_grouping_reference=0</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -245,7 +252,7 @@ return "Accounting Transactions Created."\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -253,6 +260,7 @@ return "Accounting Transactions Created."\n
<tuple>
<string>month_count</string>
<string>no_creation_need</string>
<string>keep_grouping_reference</string>
<string>DateTime</string>
<string>section_title</string>
<string>_getattr_</string>
......@@ -282,7 +290,9 @@ return "Accounting Transactions Created."\n
<string>client_title</string>
<string>amount</string>
<string>receivable_qty</string>
<string>_inplacevar_</string>
<string>ptr</string>
<string>line</string>
</tuple>
</value>
</item>
......@@ -297,6 +307,7 @@ return "Accounting Transactions Created."\n
<tuple>
<int>1</int>
<int>0</int>
<int>0</int>
</tuple>
</value>
</item>
......
95
\ No newline at end of file
96
\ 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