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

use getInventoryStat; FIXME: buildSQLQuery is disabled, because it doesn't use the good table.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4792 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ef936a56
...@@ -69,36 +69,35 @@ ...@@ -69,36 +69,35 @@
<value> <string>LOG=lambda message: context.log("AccountModule_getAccountingTransactionCount", message)\n <value> <string>LOG=lambda message: context.log("AccountModule_getAccountingTransactionCount", message)\n
\n \n
params = selection.getParams()\n params = selection.getParams()\n
kwd = dict(params)\n kwd = {} \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 from_date = params.get(\'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 = params.get(\'at_date\', preference.getPreferredAccountingTransactionAtDate())\n
if at_date :\n if at_date :\n
kwd[\'at_date\'] = at_date\n kwd[\'at_date\'] = at_date\n
section_category = preference.getPreferredAccountingTransactionSectionCategory()\n section_category = params.get(\'section_category\', preference.getPreferredAccountingTransactionSectionCategory())\n
if section_category :\n if section_category :\n
kwd[\'section_category\'] = section_category\n kwd[\'section_category\'] = section_category\n
\n \n
query = context.portal_catalog.buildSQLQuery(**kwd)\n simulation_state = params.get(\'simulation_state\', preference.getPreferredAccountingTransactionSimulationStateList())\n
\n
simulation_state = preference.getPreferredAccountingTransactionSimulationStateList()\n
if simulation_state :\n if simulation_state :\n
kwd[\'simulation_state\'] = simulation_state\n kwd[\'simulation_state\'] = simulation_state\n
\n \n
if query.get(\'where_expression\'):\n
kwd[\'where_expression\'] = query[\'where_expression\']\n
if query.get(\'from_table_list\'):\n
kwd[\'from_table_list\'] = query[\'from_table_list\']\n
\n
resource = params.get(\'accounting_transaction_line_currency\')\n resource = params.get(\'accounting_transaction_line_currency\')\n
if resource:\n if resource:\n
currency = context.portal_categories.resolveCategory(resource)\n currency = context.portal_categories.resolveCategory(resource)\n
kwd[\'resource_uid\'] = [currency.getUid()]\n kwd[\'resource_uid\'] = [currency.getUid()]\n
\n \n
query = {} #context.portal_catalog.buildSQLQuery(query_table=\'node\', **kwd)\n
if query.get(\'where_expression\'):\n
kwd[\'where_expression\'] = query[\'where_expression\']\n
if query.get(\'from_table_list\'):\n
kwd[\'from_table_list\'] = query[\'from_table_list\']\n
\n
if kw.get(\'stat\') :\n if kw.get(\'stat\') :\n
if selection.getDomain() :\n if selection.getDomain() :\n
kwd[\'selection_domain\'] = selection.getDomain()\n kwd[\'selection_domain\'] = selection.getDomain()\n
...@@ -109,63 +108,63 @@ if kw.get(\'stat\') :\n ...@@ -109,63 +108,63 @@ if kw.get(\'stat\') :\n
if selection.isInvertMode() :\n if selection.isInvertMode() :\n
kwd[\'selection_uids\'] = selection.getInvertModeUidList()\n kwd[\'selection_uids\'] = selection.getInvertModeUidList()\n
return context.portal_simulation.getInventoryStat(omit_simulation=1,\n return context.portal_simulation.getInventoryStat(omit_simulation=1,\n
**kwd)\n **kwd)\n
\n \n
return context.portal_simulation.getInventory(node_uid=context.getUid(),\n return context.portal_simulation.getInventoryStat(node_uid=context.getUid(),\n
omit_simulation=1,\n omit_simulation=1,\n
**kwd)\n **kwd)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAgAAABQAAAArAAAASwAA <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAgAAABMAAAAwAAAASwAA
AHMgAwAAZAEAhAAAfQMAdAEAfAAAZAIAgwIAgwAAfQUAdAQAfAUAgwEAfQcAdAEAdAEA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jY291bnRpbmdUcmFuc2FjdGlvbkNvdW50AQAAAHNKAAAACQIS
bnRpbmdUcmFuc2FjdGlvbkNvdW50AQAAAHNKAAAACQISAQwDGwESAQcBFAESAQcBFAESAQcBFAIh AQYDGwEkAQcBFAEkAQcBFAEkAQcBFAIkAQcBFAIVAQcBHgEjAgkBEwEgARMBIAIWARABIwEQASMB
AhIBBwEXAhMBIAETAR0CFQEHAR4BJgIWARABIwEQASMBEwEgARABIAEeAQsCMAIoAQAAAHMrAAAA EwEgARABIAEeAQsCMAIoAQAAAHMrAAAAQWNjb3VudE1vZHVsZV9nZXRBY2NvdW50aW5nVHJhbnNh
QWNjb3VudE1vZHVsZV9nZXRBY2NvdW50aW5nVHJhbnNhY3Rpb25Db3VudCgBAAAAcysAAABBY2Nv Y3Rpb25Db3VudCgBAAAAcysAAABBY2NvdW50TW9kdWxlX2dldEFjY291bnRpbmdUcmFuc2FjdGlv
dW50TW9kdWxlX2dldEFjY291bnRpbmdUcmFuc2FjdGlvbkNvdW50KAAAAAAoAAAAAHMPAAAAU2Ny bkNvdW50KAAAAAAoAAAAAHMPAAAAU2NyaXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAA
aXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value> AA==</string> </value>
</item> </item>
<item> <item>
<key> <string>_dav_writelocks</string> </key> <key> <string>_dav_writelocks</string> </key>
...@@ -211,7 +210,6 @@ aXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value> ...@@ -211,7 +210,6 @@ aXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value>
<string>LOG</string> <string>LOG</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>params</string> <string>params</string>
<string>dict</string>
<string>kwd</string> <string>kwd</string>
<string>context</string> <string>context</string>
<string>preference</string> <string>preference</string>
...@@ -219,12 +217,12 @@ aXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value> ...@@ -219,12 +217,12 @@ aXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value>
<string>_write_</string> <string>_write_</string>
<string>at_date</string> <string>at_date</string>
<string>section_category</string> <string>section_category</string>
<string>_apply_</string>
<string>query</string>
<string>simulation_state</string> <string>simulation_state</string>
<string>_getitem_</string>
<string>resource</string> <string>resource</string>
<string>currency</string> <string>currency</string>
<string>query</string>
<string>_getitem_</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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