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 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>Default</string>
<string>left</string>
<string>right</string>
<string>center</string>
</list>
......@@ -72,20 +72,20 @@
<value>
<dictionary>
<item>
<key> <string>Default</string> </key>
<key> <string>center</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_start_date</string>
<string>my_stop_date</string>
<string>my_description</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<key> <string>left</string> </key>
<value>
<list>
<string>my_description</string>
<string>my_title</string>
<string>my_start_date</string>
<string>my_stop_date</string>
</list>
</value>
</item>
......
......@@ -69,18 +69,21 @@
<item>
<key> <string>_body</string> </key>
<value> <string>if selection is not None:\n
params = selection.getParams()\n
else:\n
params = {}\n
params.update(selection.getParams())\n
kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n
kw[\'stat\'] = 1\n
kw[\'omit_input\'] = 1\n
kw[\'transaction\'] = context.getUid()\n
kw[\'transaction_uid\'] = context.getUid()\n
\n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(selection=selection, selection_params=kw, **kw)\n
row = result[0]\n
return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n
selection=selection, selection_params=kw, **kw)\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>
</item>
<item>
......@@ -103,7 +106,7 @@ return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n
</item>
<item>
<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>
<key> <string>errors</string> </key>
......@@ -131,10 +134,10 @@ return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n
<tuple>
<string>brain</string>
<string>selection</string>
<string>kw</string>
<string>params</string>
<string>None</string>
<string>_getattr_</string>
<string>params</string>
<string>kw</string>
<string>_write_</string>
<string>context</string>
<string>_apply_</string>
......
......@@ -69,18 +69,20 @@
<item>
<key> <string>_body</string> </key>
<value> <string>if selection is not None:\n
params = selection.getParams()\n
else:\n
params = {}\n
kw = {} \n
params.update(selection.getParams())\n
kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n
kw[\'stat\'] = 1\n
kw[\'omit_output\'] = 1\n
kw[\'transaction\'] = context.getUid()\n
kw[\'transaction_uid\'] = context.getUid()\n
\n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(selection=selection, **kw)\n
row = result[0]\n
return float(\'%.02f\' % (row.total_price or 0.0))\n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n
selection=selection, selection_params=kw, **kw)\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>
</item>
<item>
......@@ -103,7 +105,7 @@ return float(\'%.02f\' % (row.total_price or 0.0))\n
</item>
<item>
<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>
<key> <string>errors</string> </key>
......@@ -131,10 +133,10 @@ return float(\'%.02f\' % (row.total_price or 0.0))\n
<tuple>
<string>brain</string>
<string>selection</string>
<string>kw</string>
<string>params</string>
<string>None</string>
<string>_getattr_</string>
<string>params</string>
<string>kw</string>
<string>_write_</string>
<string>context</string>
<string>_apply_</string>
......
1
\ No newline at end of file
15
\ 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