diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml index 48dad2ea324a4d5427dd8be5e6081892b5bbb422..2dfd7f902036f8547ee58287563849f9c0469960 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml @@ -55,6 +55,7 @@ <key> <string>_body</string> </key> <value> <string encoding="cdata"><![CDATA[ +from Products.ZSQLCatalog.SQLCatalog import Query\n from Products.PythonScripts.standard import Object\n from ZTUtils import LazyFilter\n \n @@ -90,9 +91,15 @@ if group_analytic:\n if portal_type and portal_type != portal.getPortalAccountingTransactionTypeList():\n inventory_params[\'parent_portal_type\'] = portal_type\n if function:\n - inventory_params[\'function\'] = function\n + if function == \'None\':\n + inventory_params[\'function_uid\'] = Query(function_uid=None)\n + else:\n + inventory_params[\'function\'] = function\n if project:\n - inventory_params[\'project\'] = project\n + if project == \'None\':\n + inventory_params[\'project_uid\'] = Query(project_uid=None)\n + else:\n + inventory_params[\'project\'] = project\n if mirror_section_category:\n inventory_params[\'mirror_section_category\'] = mirror_section_category\n \n @@ -818,6 +825,8 @@ return new_line_list\n <string>group_analytic</string> <string>mirror_section_category</string> <string>kw</string> + <string>Products.ZSQLCatalog.SQLCatalog</string> + <string>Query</string> <string>Products.PythonScripts.standard</string> <string>Object</string> <string>ZTUtils</string> @@ -844,6 +853,7 @@ return new_line_list\n <string>inventory_params</string> <string>_write_</string> <string>tuple</string> + <string>None</string> <string>MARKER</string> <string>line_per_account</string> <string>account_used</string> @@ -859,7 +869,6 @@ return new_line_list\n <string>total_final_balance_if_credit</string> <string>False</string> <string>getKey</string> - <string>None</string> <string>analytic_title_dict</string> <string>getAnalyticTitleFromUid</string> <string>_apply_</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml index 7ff6697bc074d12f247920a836714687768683d6..295462b0abca239a35ba25567b3b8134d85a3867 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml @@ -112,12 +112,21 @@ params = dict(at_date=at_date,\n if from_date:\n params[\'from_date\'] = from_date\n if payment:\n - params[\'payment_uid\'] = traverse(payment).getUid()\n + if payment == \'None\':\n + params[\'payment_uid\'] = payment\n + else:\n + params[\'payment_uid\'] = traverse(payment).getUid()\n if project:\n - params[\'project_uid\'] = traverse(project).getUid()\n + if project == \'None\':\n + params[\'project_uid\'] = project\n + else:\n + params[\'project_uid\'] = traverse(project).getUid()\n if function:\n - params[\'function_uid\'] = traverse(function).getUid()\n - params[\'function\'] = function\n + if function == \'None\':\n + params[\'function_uid\'] = function\n + else:\n + params[\'function_uid\'] = traverse(function).getUid()\n + params[\'function\'] = function\n if mirror_section:\n params[\'mirror_section_uid\'] = traverse(mirror_section).getUid()\n if parent_portal_type:\n diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAnalyticColumnList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAnalyticColumnList.xml index 6e3b18fc3f625563f3efcb4311307a2ee13d9a96..339ec1a390b89fc4f54c60393922a23641b520c0 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAnalyticColumnList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAnalyticColumnList.xml @@ -55,7 +55,7 @@ <key> <string>_body</string> </key> <value> <string>"""Returns the list of columns to use in accounting reports (GL, account statement, journal)\n """\n -\n +from Products.ZSQLCatalog.SQLCatalog import Query\n portal = context.getPortalObject()\n request = portal.REQUEST\n \n @@ -72,13 +72,19 @@ if project_item_list:\n analytic_column_list += ((\'project\', \'Project\'),)\n for v, k in project_item_list:\n if k:\n - project_title_dict[portal.portal_categories.restrictedTraverse(k).getUid()] = v\n + if k == \'None\' or isinstance(k, Query):\n + project_title_dict[None] = \'\'\n + else:\n + project_title_dict[portal.portal_categories.restrictedTraverse(k).getUid()] = v\n function_item_list = context.AccountingTransactionLine_getFunctionItemList()\n if function_item_list:\n analytic_column_list += ((\'function\', context.AccountingTransactionLine_getFunctionBaseCategoryTitle()),)\n for v, k in function_item_list:\n if k:\n - function_title_dict[portal.portal_categories.restrictedTraverse(k).getUid()] = v\n + if k == \'None\' or isinstance(k, Query):\n + function_title_dict[None] = \'\'\n + else:\n + function_title_dict[portal.portal_categories.restrictedTraverse(k).getUid()] = v\n for base_category in \\\n portal.portal_preferences.getPreferredAccountingTransactionLineAnalyticBaseCategoryList() or []:\n title = portal.portal_categories.restrictedTraverse(base_category).getTitle()\n @@ -121,6 +127,8 @@ return analytic_column_list\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>Products.ZSQLCatalog.SQLCatalog</string> + <string>Query</string> <string>_getattr_</string> <string>context</string> <string>portal</string> @@ -135,6 +143,8 @@ return analytic_column_list\n <string>_getiter_</string> <string>v</string> <string>k</string> + <string>isinstance</string> + <string>None</string> <string>function_item_list</string> <string>base_category</string> <string>title</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml index df7a6c3ba66ff10f8126ae59dd5ac5b70de83793..1f1664cfa75bbd427922433d472dce54100479c4 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml @@ -57,6 +57,7 @@ """Get the report sections for general ledger\n """\n +from Products.ZSQLCatalog.SQLCatalog import Query\n from Products.ERP5Form.Report import ReportSection\n portal = context.portal_url.getPortalObject()\n request = portal.REQUEST\n @@ -101,10 +102,16 @@ params = dict(precision=precision,\n hide_grouping=request.get(\'omit_grouping_reference\', False))\n project = request.get(\'project\')\n if project:\n - params[\'project_uid\'] = portal.portal_categories.restrictedTraverse(project).getUid()\n + if project == \'None\':\n + params[\'project_uid\'] = Query(project_uid=None)\n + else:\n + params[\'project_uid\'] = portal.portal_categories.restrictedTraverse(project).getUid()\n function = request.get(\'function\')\n if function:\n - params[\'function_uid\'] = portal.portal_categories.restrictedTraverse(function).getUid()\n + if function == \'None\':\n + params[\'function_uid\'] = Query(function_uid=None)\n + else:\n + params[\'function_uid\'] = portal.portal_categories.restrictedTraverse(function).getUid()\n \n default_selection_params = params.copy()\n \n @@ -376,7 +383,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n at_date=at_date,\n group_by_node=1,\n group_by_section=0,\n - group_by_paymnent=1,\n + group_by_payment=1,\n group_by_resource=0,\n **params):\n key = (inventory.node_relative_url, None, inventory.payment_uid)\n @@ -405,7 +412,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n at_date=from_date,\n group_by_node=1,\n group_by_section=0,\n - group_by_paymnent=1,\n + group_by_payment=1,\n group_by_resource=0,\n **params):\n key = (inventory.node_relative_url, None, inventory.payment_uid)\n @@ -481,6 +488,8 @@ return report_section_list\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>Products.ZSQLCatalog.SQLCatalog</string> + <string>Query</string> <string>Products.ERP5Form.Report</string> <string>ReportSection</string> <string>_getattr_</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml index 3ae3401e195f169c04bbf3b1ab7c56b7eb8e96e8..30c0c01ab5a7a60d822af99695875af0aeecc4aa 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml @@ -58,6 +58,7 @@ This script is indented to be used on custom listfields for accounting lines, and on reports.\n If this script returns an empty list, it means that reports by project are disabled.\n """\n +from Products.ERP5Type.Message import translateString\n portal = context.getPortalObject()\n request = portal.REQUEST\n \n @@ -82,7 +83,7 @@ if context.getPortalType() == \'Accounting Transaction Module\':\n project_list.sort(key=lambda x:x[0])\n if not project_list:\n return [] # returning an empty list, not to add project column on reports\n - return [(\'\', \'\')] + project_list\n + return [(\'\', \'\'), (translateString(\'No Project\'), \'None\')] + project_list\n \n # case 2: script is used on custom listfields.\n # for now the script has to be customized in such case.\n @@ -124,6 +125,8 @@ return [(\'\', \'\')]\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>Products.ERP5Type.Message</string> + <string>translateString</string> <string>_getattr_</string> <string>context</string> <string>portal</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.xml index d06bebbec9633bcc1efd5d802781cc7a589d4b66..3ddd17e85dba6b539fb9571cf151ca95de341efd 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.xml @@ -55,6 +55,7 @@ <key> <string>_body</string> </key> <value> <string encoding="cdata"><![CDATA[ +from Products.ZSQLCatalog.SQLCatalog import Query\n from Products.ERP5Type.Message import translateString\n from Products.ERP5Type.Log import log\n portal = context.getPortalObject()\n @@ -74,12 +75,24 @@ if kw.get(\'node_uid\'):\n params[\'node_uid\'] = kw[\'node_uid\']\n if kw.get(\'mirror_section_uid\'):\n params[\'mirror_section_uid\'] = kw[\'mirror_section_uid\']\n -if kw.get(\'payment_uid\'):\n - params[\'payment_uid\'] = kw[\'payment_uid\']\n -if kw.get(\'project_uid\'):\n - params[\'project_uid\'] = kw[\'project_uid\']\n -if kw.get(\'function_uid\'):\n - params[\'function_uid\'] = kw[\'function_uid\']\n +payment_uid = kw.get(\'payment_uid\')\n +if payment_uid:\n + if payment_uid == \'None\':\n + params[\'payment_uid\'] = Query(payment_uid=None)\n + else:\n + params[\'payment_uid\'] = payment_uid\n +project_uid = kw.get(\'project_uid\')\n +if project_uid:\n + if project_uid == \'None\':\n + params[\'project_uid\'] = Query(project_uid=None)\n + else:\n + params[\'project_uid\'] = project_uid\n +function_uid = kw.get(\'function_uid\')\n +if function_uid:\n + if function_uid == \'None\':\n + params[\'function_uid\'] = Query(function_uid=None)\n + else:\n + params[\'function_uid\'] = function_uid\n if node_category_strict_membership:\n params[\'node_category_strict_membership\'] = node_category_strict_membership\n if node_category:\n @@ -208,7 +221,6 @@ if from_date or is_pl_account:\n if context.portal_selections.getSelectionParamsFor(selection_name).get(\'hide_grouping\'):\n params[\'where_expression\'] = \'catalog.grouping_reference is NULL\'\n \n -\n # We try not to convert to a list, hence the copy & paste\n return portal.portal_simulation.getMovementHistoryList(\n from_date=from_date,\n @@ -267,6 +279,8 @@ return portal.portal_simulation.getMovementHistoryList(\n <string>selection_name</string> <string>src__</string> <string>kw</string> + <string>Products.ZSQLCatalog.SQLCatalog</string> + <string>Query</string> <string>Products.ERP5Type.Message</string> <string>translateString</string> <string>Products.ERP5Type.Log</string> @@ -279,6 +293,9 @@ return portal.portal_simulation.getMovementHistoryList(\n <string>None</string> <string>_getitem_</string> <string>_write_</string> + <string>payment_uid</string> + <string>project_uid</string> + <string>function_uid</string> <string>new_result</string> <string>net_balance</string> <string>False</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.xml index f1242eba597af84de71024f933036e7a5c7d1717..6bf8f4ad233e2815176db4c873483aa7e2dda9fd 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.xml @@ -53,7 +53,8 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>portal = context.getPortalObject()\n + <value> <string>from Products.ZSQLCatalog.SQLCatalog import Query\n +portal = context.getPortalObject()\n params = portal.ERP5Accounting_getParams(selection_name=selection_name)\n getInventoryAssetPrice = portal.portal_simulation.getInventoryAssetPrice\n getSelectionDomainDictFor = context.portal_selections.getSelectionDomainDictFor\n @@ -64,14 +65,25 @@ if kw.get(\'node_uid\'):\n if kw.get(\'mirror_section_uid\'):\n params[\'mirror_section_uid\'] = kw[\'mirror_section_uid\']\n \n -if kw.get(\'function_uid\'):\n - params[\'function_uid\'] = kw[\'function_uid\']\n -if kw.get(\'project_uid\'):\n - params[\'project_uid\'] = kw[\'project_uid\']\n +payment_uid = kw.get(\'payment_uid\')\n +if payment_uid:\n + if payment_uid == \'None\':\n + params[\'payment_uid\'] = Query(payment_uid=None)\n + else:\n + params[\'payment_uid\'] = payment_uid\n +project_uid = kw.get(\'project_uid\')\n +if project_uid:\n + if project_uid == \'None\':\n + params[\'project_uid\'] = Query(project_uid=None)\n + else:\n + params[\'project_uid\'] = project_uid\n +function_uid = kw.get(\'function_uid\')\n +if function_uid:\n + if function_uid == \'None\':\n + params[\'function_uid\'] = Query(function_uid=None)\n + else:\n + params[\'function_uid\'] = function_uid\n \n -# FIXME: bank account uses quantity, not total_price\n -if kw.get(\'payment_uid\'):\n - params[\'payment_uid\'] = kw[\'payment_uid\']\n if kw.get(\'node_category_strict_membership\'):\n params[\'node_category_strict_membership\'] = \\\n kw[\'node_category_strict_membership\']\n @@ -179,6 +191,8 @@ return getInventoryAssetPrice(\n <string>omit_output</string> <string>selection_name</string> <string>kw</string> + <string>Products.ZSQLCatalog.SQLCatalog</string> + <string>Query</string> <string>_getattr_</string> <string>context</string> <string>portal</string> @@ -187,9 +201,12 @@ return getInventoryAssetPrice(\n <string>getSelectionDomainDictFor</string> <string>_getitem_</string> <string>_write_</string> + <string>payment_uid</string> + <string>None</string> + <string>project_uid</string> + <string>function_uid</string> <string>node</string> <string>period_start_date</string> - <string>None</string> <string>at_date</string> <string>_apply_</string> <string>period_openning_balance</string> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 93bf02c8ecd8b93641d7b7e21b3e6bc16ef9320a..f699c943718143f1ac6fcf51bdb36bce7c5ea443 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -1302 \ No newline at end of file +1309 \ No newline at end of file