Commit 38a3aa6d authored by Jérome Perrin's avatar Jérome Perrin

add editable fields for better display for debit, credit and date on accounting module listbox



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10366 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1390cc8a
......@@ -68,7 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if selection is not None:\n
<value> <string>if selection is None:\n
selection = context.getPortalObject()\\\n
.portal_selections.getSelectionFor(\'accounting_selection\')\n
if selection is not None:\n
params.update(selection.getParams())\n
kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n
......@@ -81,8 +84,8 @@ result = context.AccountingTransactionModule_zGetAccountingTransactionList(\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
# we do not want -0 to be displayed\n
return (row.total_price and -row.total_price or 0)\n
return 0.\n
</string> </value>
</item>
......@@ -137,14 +140,13 @@ return 0.\n
<string>params</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>kw</string>
<string>_write_</string>
<string>context</string>
<string>_apply_</string>
<string>result</string>
<string>_getitem_</string>
<string>row</string>
<string>float</string>
</tuple>
</value>
</item>
......
......@@ -68,7 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if selection is not None:\n
<value> <string>if selection is None:\n
selection = context.getPortalObject()\\\n
.portal_selections.getSelectionFor(\'accounting_selection\')\n
if selection is not None:\n
params.update(selection.getParams())\n
kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n
......@@ -79,9 +82,7 @@ kw[\'transaction_uid\'] = context.getUid()\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 result[0].total_price\n
return 0.\n
</string> </value>
</item>
......@@ -136,14 +137,12 @@ return 0.\n
<string>params</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>kw</string>
<string>_write_</string>
<string>context</string>
<string>_apply_</string>
<string>result</string>
<string>_getitem_</string>
<string>row</string>
<string>float</string>
</tuple>
</value>
</item>
......
......@@ -62,6 +62,7 @@
<value>
<list>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
......@@ -74,9 +75,18 @@
<value>
<list>
<string>listbox</string>
<string>listbox_credit</string>
<string>listbox_debit</string>
<string>listbox_delivery_start_date</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
......
......@@ -366,12 +366,12 @@
<string>State</string>
</tuple>
<tuple>
<string>AccountingTransactionModule_getSourceCredit</string>
<string>Credit</string>
<string>debit</string>
<string>Debit</string>
</tuple>
<tuple>
<string>AccountingTransactionModule_getSourceDebit</string>
<string>Debit</string>
<string>credit</string>
<string>Credit</string>
</tuple>
<tuple>
<string>creation_date</string>
......@@ -379,7 +379,7 @@
</tuple>
<tuple>
<string>modification_date</string>
<string>Creation Date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
......@@ -427,11 +427,11 @@
<string>State</string>
</tuple>
<tuple>
<string>AccountingTransactionModule_getSourceDebit</string>
<string>debit</string>
<string>Debit</string>
</tuple>
<tuple>
<string>AccountingTransactionModule_getSourceCredit</string>
<string>credit</string>
<string>Credit</string>
</tuple>
</list>
......@@ -478,7 +478,20 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>debit</string>
<string>Debit</string>
</tuple>
<tuple>
<string>credit</string>
<string>Credit</string>
</tuple>
<tuple>
<string>delivery.start_date</string>
<string>delivery_start_date</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -661,11 +674,11 @@
<value>
<list>
<tuple>
<string>AccountingTransactionModule_getSourceDebit</string>
<string>debit</string>
<string>AccountingTransactionModule_statSourceDebit</string>
</tuple>
<tuple>
<string>AccountingTransactionModule_getSourceCredit</string>
<string>credit</string>
<string>AccountingTransactionModule_statSourceCredit</string>
</tuple>
</list>
......
52
\ No newline at end of file
53
\ 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