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 @@ ...@@ -68,7 +68,10 @@
</item> </item>
<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 None:\n
selection = context.getPortalObject()\\\n
.portal_selections.getSelectionFor(\'accounting_selection\')\n
if selection is not None:\n
params.update(selection.getParams())\n params.update(selection.getParams())\n
kw = {}\n kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n kw[\'section_category\'] = params.get(\'section_category\')\n
...@@ -81,8 +84,8 @@ result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n ...@@ -81,8 +84,8 @@ result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n
\n \n
if result:\n if result:\n
row = result[0]\n row = result[0]\n
# FIXME: No rounding should be done here\n # we do not want -0 to be displayed\n
return float(\'%.02f\' % (row.total_price and - row.total_price or 0.0))\n return (row.total_price and -row.total_price or 0)\n
return 0.\n return 0.\n
</string> </value> </string> </value>
</item> </item>
...@@ -137,14 +140,13 @@ return 0.\n ...@@ -137,14 +140,13 @@ return 0.\n
<string>params</string> <string>params</string>
<string>None</string> <string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>kw</string> <string>kw</string>
<string>_write_</string> <string>_write_</string>
<string>context</string>
<string>_apply_</string> <string>_apply_</string>
<string>result</string> <string>result</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>row</string> <string>row</string>
<string>float</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -68,7 +68,10 @@ ...@@ -68,7 +68,10 @@
</item> </item>
<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 None:\n
selection = context.getPortalObject()\\\n
.portal_selections.getSelectionFor(\'accounting_selection\')\n
if selection is not None:\n
params.update(selection.getParams())\n params.update(selection.getParams())\n
kw = {}\n kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n kw[\'section_category\'] = params.get(\'section_category\')\n
...@@ -79,9 +82,7 @@ kw[\'transaction_uid\'] = context.getUid()\n ...@@ -79,9 +82,7 @@ kw[\'transaction_uid\'] = context.getUid()\n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n result = context.AccountingTransactionModule_zGetAccountingTransactionList(\n
selection=selection, selection_params=kw, **kw)\n selection=selection, selection_params=kw, **kw)\n
if result:\n if result:\n
row = result[0]\n return result[0].total_price\n
# FIXME: No rounding should be done here\n
return float(\'%.02f\' % (row.total_price or 0.0))\n
return 0.\n return 0.\n
</string> </value> </string> </value>
</item> </item>
...@@ -136,14 +137,12 @@ return 0.\n ...@@ -136,14 +137,12 @@ return 0.\n
<string>params</string> <string>params</string>
<string>None</string> <string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>kw</string> <string>kw</string>
<string>_write_</string> <string>_write_</string>
<string>context</string>
<string>_apply_</string> <string>_apply_</string>
<string>result</string> <string>result</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>row</string>
<string>float</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<value> <value>
<list> <list>
<string>bottom</string> <string>bottom</string>
<string>hidden</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -74,9 +75,18 @@ ...@@ -74,9 +75,18 @@
<value> <value>
<list> <list>
<string>listbox</string> <string>listbox</string>
<string>listbox_credit</string>
<string>listbox_debit</string>
<string>listbox_delivery_start_date</string>
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -366,12 +366,12 @@ ...@@ -366,12 +366,12 @@
<string>State</string> <string>State</string>
</tuple> </tuple>
<tuple> <tuple>
<string>AccountingTransactionModule_getSourceCredit</string> <string>debit</string>
<string>Credit</string> <string>Debit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>AccountingTransactionModule_getSourceDebit</string> <string>credit</string>
<string>Debit</string> <string>Credit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>creation_date</string> <string>creation_date</string>
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
</tuple> </tuple>
<tuple> <tuple>
<string>modification_date</string> <string>modification_date</string>
<string>Creation Date</string> <string>Modification Date</string>
</tuple> </tuple>
</list> </list>
</value> </value>
...@@ -427,11 +427,11 @@ ...@@ -427,11 +427,11 @@
<string>State</string> <string>State</string>
</tuple> </tuple>
<tuple> <tuple>
<string>AccountingTransactionModule_getSourceDebit</string> <string>debit</string>
<string>Debit</string> <string>Debit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>AccountingTransactionModule_getSourceCredit</string> <string>credit</string>
<string>Credit</string> <string>Credit</string>
</tuple> </tuple>
</list> </list>
...@@ -478,7 +478,20 @@ ...@@ -478,7 +478,20 @@
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <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> </value>
</item> </item>
<item> <item>
...@@ -661,11 +674,11 @@ ...@@ -661,11 +674,11 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>AccountingTransactionModule_getSourceDebit</string> <string>debit</string>
<string>AccountingTransactionModule_statSourceDebit</string> <string>AccountingTransactionModule_statSourceDebit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>AccountingTransactionModule_getSourceCredit</string> <string>credit</string>
<string>AccountingTransactionModule_statSourceCredit</string> <string>AccountingTransactionModule_statSourceCredit</string>
</tuple> </tuple>
</list> </list>
......
52 53
\ 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