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

fix field group namings in AccountingPeriod_view

minor optimisation on AccountingTransactionModule_zGetAccountingTransactionList
Prevent IndexError in AccountingTransactionModule_getSourceDebit/Credit



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9194 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 635b1d45
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<key> <string>group_list</string> </key> <key> <string>group_list</string> </key>
<value> <value>
<list> <list>
<string>Default</string> <string>left</string>
<string>right</string> <string>right</string>
<string>center</string> <string>center</string>
</list> </list>
...@@ -72,25 +72,25 @@ ...@@ -72,25 +72,25 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>Default</string> </key> <key> <string>center</string> </key>
<value> <value>
<list> <list>
<string>my_title</string> <string>my_description</string>
<string>my_start_date</string>
<string>my_stop_date</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>center</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>my_description</string> <string>my_title</string>
<string>my_start_date</string>
<string>my_stop_date</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_translated_simulation_state_title</string> <string>my_translated_simulation_state_title</string>
......
...@@ -69,18 +69,21 @@ ...@@ -69,18 +69,21 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if selection is not None:\n <value> <string>if selection is not None:\n
params = selection.getParams()\n params.update(selection.getParams())\n
else:\n
params = {}\n
kw = {}\n kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n kw[\'section_category\'] = params.get(\'section_category\')\n
kw[\'stat\'] = 1\n kw[\'stat\'] = 1\n
kw[\'omit_input\'] = 1\n kw[\'omit_input\'] = 1\n
kw[\'transaction\'] = context.getUid()\n kw[\'transaction_uid\'] = context.getUid()\n
\n \n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(selection=selection, selection_params=kw, **kw)\n result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n
row = result[0]\n selection=selection, selection_params=kw, **kw)\n
return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n \n
if result:\n
row = result[0]\n
# FIXME: No rounding should be done here\n
return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n
return 0.\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -103,7 +106,7 @@ return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n ...@@ -103,7 +106,7 @@ return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>brain=None, selection=None, **kw</string> </value> <value> <string>brain=None, selection=None, **params</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -131,10 +134,10 @@ return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n ...@@ -131,10 +134,10 @@ return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n
<tuple> <tuple>
<string>brain</string> <string>brain</string>
<string>selection</string> <string>selection</string>
<string>kw</string> <string>params</string>
<string>None</string> <string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>params</string> <string>kw</string>
<string>_write_</string> <string>_write_</string>
<string>context</string> <string>context</string>
<string>_apply_</string> <string>_apply_</string>
......
...@@ -69,18 +69,20 @@ ...@@ -69,18 +69,20 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if selection is not None:\n <value> <string>if selection is not None:\n
params = selection.getParams()\n params.update(selection.getParams())\n
else:\n kw = {}\n
params = {}\n
kw = {} \n
kw[\'section_category\'] = params.get(\'section_category\')\n kw[\'section_category\'] = params.get(\'section_category\')\n
kw[\'stat\'] = 1\n kw[\'stat\'] = 1\n
kw[\'omit_output\'] = 1\n kw[\'omit_output\'] = 1\n
kw[\'transaction\'] = context.getUid()\n kw[\'transaction_uid\'] = context.getUid()\n
\n \n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(selection=selection, **kw)\n result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n
row = result[0]\n selection=selection, selection_params=kw, **kw)\n
return float(\'%.02f\' % (row.total_price or 0.0))\n if result:\n
row = result[0]\n
# FIXME: No rounding should be done here\n
return float(\'%.02f\' % (row.total_price or 0.0))\n
return 0.\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -103,7 +105,7 @@ return float(\'%.02f\' % (row.total_price or 0.0))\n ...@@ -103,7 +105,7 @@ return float(\'%.02f\' % (row.total_price or 0.0))\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>brain=None, selection=None, **kw</string> </value> <value> <string>brain=None, selection=None, **params</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -131,10 +133,10 @@ return float(\'%.02f\' % (row.total_price or 0.0))\n ...@@ -131,10 +133,10 @@ return float(\'%.02f\' % (row.total_price or 0.0))\n
<tuple> <tuple>
<string>brain</string> <string>brain</string>
<string>selection</string> <string>selection</string>
<string>kw</string> <string>params</string>
<string>None</string> <string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>params</string> <string>kw</string>
<string>_write_</string> <string>_write_</string>
<string>context</string> <string>context</string>
<string>_apply_</string> <string>_apply_</string>
......
1 15
\ 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