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

bug fix: do not automatically read "from_date" in preference on reports, as...

bug fix: do not automatically read "from_date" in preference on reports, as one may want a report without from_date


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5723 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a3258935
...@@ -110,6 +110,8 @@ preferences = {\n ...@@ -110,6 +110,8 @@ preferences = {\n
if from_date:\n if from_date:\n
params[\'from_date\'] = from_date\n params[\'from_date\'] = from_date\n
preferences[\'preferred_accounting_transaction_from_date\'] = from_date\n preferences[\'preferred_accounting_transaction_from_date\'] = from_date\n
else :\n
params[\'no_from_date\'] = 1\n
if source_payment :\n if source_payment :\n
params[\'payment_uid\'] = context.restrictedTraverse(source_payment).getUid()\n params[\'payment_uid\'] = context.restrictedTraverse(source_payment).getUid()\n
if destination_section :\n if destination_section :\n
...@@ -131,7 +133,7 @@ account_columns = (\n ...@@ -131,7 +133,7 @@ account_columns = (\n
# (\'translated_simulation_state_title\', \'State\'),\n # (\'translated_simulation_state_title\', \'State\'),\n
(\'debit\', \'Debit\'),\n (\'debit\', \'Debit\'),\n
(\'credit\', \'Credit\'),\n (\'credit\', \'Credit\'),\n
(\'reference\', \'Accounting Transaction Reference\'),\n (\'specific_reference\', \'Accounting Transaction Reference\'),\n
(\'net_balance\', \'Balance\'),\n (\'net_balance\', \'Balance\'),\n
)\n )\n
\n \n
......
...@@ -106,6 +106,8 @@ preferences = {\n ...@@ -106,6 +106,8 @@ preferences = {\n
if from_date:\n if from_date:\n
params[\'from_date\'] = from_date\n params[\'from_date\'] = from_date\n
preferences[\'preferred_accounting_transaction_from_date\'] = from_date\n preferences[\'preferred_accounting_transaction_from_date\'] = from_date\n
else :\n
params[\'no_from_date\'] = 1\n
\n \n
## FIXME: issue in reporting famework in ERP5 ? \n ## FIXME: issue in reporting famework in ERP5 ? \n
from Products.ERP5Type.Cache import clearCache\n from Products.ERP5Type.Cache import clearCache\n
......
...@@ -99,7 +99,9 @@ params = {\n ...@@ -99,7 +99,9 @@ params = {\n
\n \n
params[\'hide_grouping\'] = request[\'omit_grouped_references\']\n params[\'hide_grouping\'] = request[\'omit_grouped_references\']\n
if from_date:\n if from_date:\n
params[\'from_date\'] = from_date\n params[\'from_date\'] = from_date\n
else :\n
params[\'no_from_date\'] = 1\n
\n \n
portal = context.portal_url.getPortalObject()\n portal = context.portal_url.getPortalObject()\n
simulation_tool = portal.portal_simulation\n simulation_tool = portal.portal_simulation\n
......
...@@ -73,7 +73,10 @@ from Products.ERP5Type.Document import newTempAccountingTransaction\n ...@@ -73,7 +73,10 @@ from Products.ERP5Type.Document import newTempAccountingTransaction\n
kwd={"omit_simulation" : 1}\n kwd={"omit_simulation" : 1}\n
# read settings from user preference\n # read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n preference = context.getPortalObject().portal_preferences\n
from_date = kw.get(\'from_date\', preference\\\n if kw.get(\'no_from_date\', 0) :\n
from_date = None \n
else :\n
from_date = kw.get(\'from_date\', preference\\\n
.getPreferredAccountingTransactionFromDate())\n .getPreferredAccountingTransactionFromDate())\n
if from_date :\n if from_date :\n
kwd[\'from_date\'] = from_date\n kwd[\'from_date\'] = from_date\n
...@@ -239,6 +242,7 @@ return new_result\n ...@@ -239,6 +242,7 @@ return new_result\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>preference</string> <string>preference</string>
<string>None</string>
<string>from_date</string> <string>from_date</string>
<string>_write_</string> <string>_write_</string>
<string>at_date</string> <string>at_date</string>
...@@ -254,7 +258,6 @@ return new_result\n ...@@ -254,7 +258,6 @@ return new_result\n
<string>_apply_</string> <string>_apply_</string>
<string>result</string> <string>result</string>
<string>net_balance</string> <string>net_balance</string>
<string>None</string>
<string>get_inventory_kw</string> <string>get_inventory_kw</string>
<string>getInventoryAssetPrice</string> <string>getInventoryAssetPrice</string>
<string>last_total_debit</string> <string>last_total_debit</string>
......
...@@ -77,10 +77,14 @@ if kw.get(\'resource\'):\n ...@@ -77,10 +77,14 @@ if kw.get(\'resource\'):\n
\n \n
# read settings from user preference\n # read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n preference = context.getPortalObject().portal_preferences\n
from_date = kw.get(\'from_date\',\n if kw.get(\'no_from_date\', 0) :\n
from_date = None \n
else :\n
from_date = kw.get(\'from_date\',\n
preference.getPreferredAccountingTransactionFromDate())\n preference.getPreferredAccountingTransactionFromDate())\n
if from_date :\n if from_date :\n
params[\'from_date\'] = from_date\n params[\'from_date\'] = from_date\n
\n
at_date = kw.get(\'at_date\',\n at_date = kw.get(\'at_date\',\n
preference.getPreferredAccountingTransactionAtDate())\n preference.getPreferredAccountingTransactionAtDate())\n
if at_date :\n if at_date :\n
...@@ -191,6 +195,7 @@ return float(\'%.02f\' % (row.total_price or 0.0) )\n ...@@ -191,6 +195,7 @@ return float(\'%.02f\' % (row.total_price or 0.0) )\n
<string>KeyError</string> <string>KeyError</string>
<string>AttributeError</string> <string>AttributeError</string>
<string>preference</string> <string>preference</string>
<string>None</string>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>simulation_state</string> <string>simulation_state</string>
......
...@@ -74,7 +74,11 @@ LOG = lambda msg : context.log(\'Entity_getAccountingTransactionList\', msg)\n ...@@ -74,7 +74,11 @@ LOG = lambda msg : context.log(\'Entity_getAccountingTransactionList\', msg)\n
\n \n
# read settings from user preference\n # read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n preference = context.getPortalObject().portal_preferences\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n \n
if kw.get(\'no_from_date\', 0) :\n
from_date = None \n
else :\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n
if from_date :\n if from_date :\n
kwd[\'from_date\'] = from_date\n kwd[\'from_date\'] = from_date\n
\n \n
...@@ -183,6 +187,7 @@ return new_result\n ...@@ -183,6 +187,7 @@ return new_result\n
<string>LOG</string> <string>LOG</string>
<string>context</string> <string>context</string>
<string>preference</string> <string>preference</string>
<string>None</string>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>simulation_state</string> <string>simulation_state</string>
...@@ -195,7 +200,6 @@ return new_result\n ...@@ -195,7 +200,6 @@ return new_result\n
<string>_getiter_</string> <string>_getiter_</string>
<string>l</string> <string>l</string>
<string>o</string> <string>o</string>
<string>None</string>
<string>c</string> <string>c</string>
</tuple> </tuple>
</value> </value>
......
...@@ -73,7 +73,10 @@ if kw.has_key(\'hide_grouping\'):\n ...@@ -73,7 +73,10 @@ if kw.has_key(\'hide_grouping\'):\n
\n \n
# read settings from user preference\n # read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n preference = context.getPortalObject().portal_preferences\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n if kw.get(\'no_from_date\', 0) :\n
from_date = None \n
else :\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n
if from_date :\n if from_date :\n
kwd[\'from_date\'] = from_date\n kwd[\'from_date\'] = from_date\n
at_date = preference.getPreferredAccountingTransactionAtDate()\n at_date = preference.getPreferredAccountingTransactionAtDate()\n
...@@ -156,6 +159,7 @@ return float(\'%.02f\' % row.total_price or 0)\n ...@@ -156,6 +159,7 @@ return float(\'%.02f\' % row.total_price or 0)\n
<string>_write_</string> <string>_write_</string>
<string>context</string> <string>context</string>
<string>preference</string> <string>preference</string>
<string>None</string>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>simulation_state</string> <string>simulation_state</string>
......
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