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 cce655fa6b1d4bc9a3aa40aa018c41448a8a4c95..fd1fed3c7697c67776e24a7012d2ea75ca86b91f 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 @@ -82,6 +82,7 @@ payment = request.get(\'payment\', None)\n function = request.get(\'function\', None)\n project = request.get(\'project\', None)\n simulation_state = request[\'simulation_state\']\n +hide_analytic = request[\'hide_analytic\']\n from_date = request.get(\'from_date\', None)\n detailed_from_date_summary = request.get(\'detailed_from_date_summary\', 0)\n omit_grouping_reference = request.get(\'omit_grouping_reference\', 0)\n @@ -122,6 +123,14 @@ if mirror_section:\n if parent_portal_type:\n params[\'parent_portal_type\'] = parent_portal_type\n \n +analytic_column_list = ()\n +if hide_analytic:\n + params[\'group_by\'] = ( \'explanation_uid\',\n + \'mirror_section_uid\',\n + \'payment_uid\', )\n +else:\n + analytic_column_list = context.AccountModule_getAnalyticColumnList()\n + params[\'analytic_column_list\'] = analytic_column_list\n \n selection_columns = (\n (\'Movement_getSpecificReference\', \'Transaction Reference\'),\n @@ -129,7 +138,7 @@ selection_columns = (\n (\'Movement_getExplanationTitle\', \'Accounting Transaction Title\'), )\n if len(section_uid) > 1:\n selection_columns += ( (\'section_title\', \'Section\'), )\n -selection_columns += (\n +selection_columns += analytic_column_list + (\n (\'Movement_getMirrorSectionTitle\', \'Third Party\'),\n (\'debit_price\', \'Debit\'),\n (\'credit_price\', \'Credit\'),\n @@ -227,6 +236,7 @@ return report_section_list\n <string>function</string> <string>project</string> <string>simulation_state</string> + <string>hide_analytic</string> <string>from_date</string> <string>detailed_from_date_summary</string> <string>omit_grouping_reference</string> @@ -237,6 +247,7 @@ return report_section_list\n <string>dict</string> <string>params</string> <string>_write_</string> + <string>analytic_column_list</string> <string>selection_columns</string> <string>len</string> <string>_inplacevar_</string> 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 new file mode 100644 index 0000000000000000000000000000000000000000..6e3b18fc3f625563f3efcb4311307a2ee13d9a96 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAnalyticColumnList.xml @@ -0,0 +1,168 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>"""Returns the list of columns to use in accounting reports (GL, account statement, journal)\n +"""\n +\n +portal = context.getPortalObject()\n +request = portal.REQUEST\n +\n +# cache the title in the request, it will be used by Movement_getProjectTitle\n +# and Movement_getFunctionTitle scripts\n +request.other[\'Movement_getProjectTitle.project_title_dict\'\n + ] = project_title_dict = dict()\n +request.other[\'Movement_getFunctionTitle.function_title_dict\'\n + ] = function_title_dict = dict()\n +\n +analytic_column_list = ()\n +project_item_list = context.AccountingTransactionLine_getProjectItemList()\n +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 +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 +for base_category in \\\n + portal.portal_preferences.getPreferredAccountingTransactionLineAnalyticBaseCategoryList() or []:\n + title = portal.portal_categories.restrictedTraverse(base_category).getTitle()\n + analytic_column_list += ((\'%s_translated_title\' % base_category, title),)\n +\n +return analytic_column_list\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>errors</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>func_code</string> </key> + <value> + <object> + <klass> + <global name="FuncCode" module="Shared.DC.Scripts.Signature"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>co_argcount</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>_getattr_</string> + <string>context</string> + <string>portal</string> + <string>request</string> + <string>dict</string> + <string>_write_</string> + <string>project_title_dict</string> + <string>function_title_dict</string> + <string>analytic_column_list</string> + <string>project_item_list</string> + <string>_inplacevar_</string> + <string>_getiter_</string> + <string>v</string> + <string>k</string> + <string>function_item_list</string> + <string>base_category</string> + <string>title</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>AccountModule_getAnalyticColumnList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> 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 7936433d3a2dceb3dea7b3c51e47142edd927517..5af53dfb5d490dd73bf8c722207b0c7639780a4e 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 @@ -58,8 +58,8 @@ """Get the report sections for general ledger\n """\n from Products.ERP5Form.Report import ReportSection\n -request = context.REQUEST\n portal = context.portal_url.getPortalObject()\n +request = portal.REQUEST\n cat_tool = portal.portal_categories\n sim_tool = portal.portal_simulation\n Base_translateString = context.Base_translateString\n @@ -69,6 +69,7 @@ section_category = request[\'section_category\']\n section_uid = context.Base_getSectionUidListForSectionCategory(\n section_category, request[\'section_category_strict\'])\n simulation_state = request[\'simulation_state\']\n +hide_analytic = request[\'hide_analytic\']\n from_date = request.get(\'from_date\', None)\n gap_list = []\n for gap in request.get(\'gap_list\', ()):\n @@ -103,8 +104,15 @@ function = request.get(\'function\')\n if function:\n params[\'function_uid\'] = portal.portal_categories.restrictedTraverse(function).getUid()\n \n -analytic_columns = ()\n -group_analytics = False # XXX \'group\' in the sense of grouping\n +default_selection_params = params.copy()\n +\n +analytic_column_list = ()\n +if hide_analytic:\n + default_selection_params[\'group_by\'] = ( \'explanation_uid\',\n + \'mirror_section_uid\',\n + \'payment_uid\' )\n +else:\n + analytic_column_list = context.AccountModule_getAnalyticColumnList()\n \n account_columns = (\n (\'Movement_getSpecificReference\', \'Reference\'),\n @@ -116,6 +124,7 @@ account_columns = (\n if len(simulation_state) > 1:\n account_columns += (\n (\'getTranslatedSimulationStateTitle\', \'State\'),)\n +account_columns += analytic_column_list\n account_columns += (\n (\'debit_price\', \'Debit\'),\n (\'credit_price\', \'Credit\'),\n @@ -205,7 +214,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n key = (inventory.node_relative_url, None, None)\n existing_section_dict[key] = True\n \n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = from_date\n selection_params[\'at_date\'] = at_date\n selection_params[\'node_uid\'] = inventory.node_uid\n @@ -238,7 +247,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n continue\n existing_section_dict[key] = True\n \n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = from_date\n selection_params[\'at_date\'] = at_date\n selection_params[\'node_uid\'] = inventory.node_uid\n @@ -267,7 +276,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n group_by_resource=0,\n **params):\n key = (inventory.node_relative_url, None, None)\n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = max(from_date, period_start_date)\n selection_params[\'at_date\'] = at_date\n selection_params[\'period_start_date\'] = max(from_date, period_start_date)\n @@ -299,7 +308,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n key = (inventory.node_relative_url, inventory.mirror_section_uid, None)\n existing_section_dict[key] = True\n \n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = from_date\n selection_params[\'at_date\'] = at_date\n selection_params[\'node_uid\'] = inventory.node_uid\n @@ -333,7 +342,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n continue\n existing_section_dict[key] = True\n \n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = from_date\n selection_params[\'at_date\'] = at_date\n selection_params[\'node_uid\'] = inventory.node_uid\n @@ -365,7 +374,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n key = (inventory.node_relative_url, None, inventory.payment_uid)\n existing_section_dict[key] = True\n \n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = from_date\n selection_params[\'at_date\'] = at_date\n selection_params[\'node_uid\'] = inventory.node_uid\n @@ -398,7 +407,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n continue\n existing_section_dict[key] = True\n \n - selection_params = params.copy()\n + selection_params = default_selection_params.copy()\n selection_params[\'from_date\'] = from_date\n selection_params[\'at_date\'] = at_date\n selection_params[\'node_uid\'] = inventory.node_uid\n @@ -416,7 +425,7 @@ for inventory in portal.portal_simulation.getInventoryList(\n \n report_section_list.sort(key=ReportSection.getTitle)\n \n -total_params = params.copy()\n +total_params = default_selection_params.copy()\n total_params[\'at_date\'] = at_date\n report_section_list.append(ReportSection(\n path=context.getPhysicalPath(),\n @@ -468,8 +477,8 @@ return report_section_list\n <string>ReportSection</string> <string>_getattr_</string> <string>context</string> - <string>request</string> <string>portal</string> + <string>request</string> <string>cat_tool</string> <string>sim_tool</string> <string>Base_translateString</string> @@ -478,6 +487,7 @@ return report_section_list\n <string>section_category</string> <string>section_uid</string> <string>simulation_state</string> + <string>hide_analytic</string> <string>None</string> <string>from_date</string> <string>gap_list</string> @@ -495,8 +505,8 @@ return report_section_list\n <string>params</string> <string>project</string> <string>function</string> - <string>analytic_columns</string> - <string>group_analytics</string> + <string>default_selection_params</string> + <string>analytic_column_list</string> <string>account_columns</string> <string>len</string> <string>_inplacevar_</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog.xml index 02f43bd0e41ac742ac0e636026da20e546463643..e5354987580ea775c935943119d465884b8bd288 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog.xml @@ -101,6 +101,7 @@ <string>your_at_date</string> <string>your_detailed_from_date_summary</string> <string>your_omit_grouping_reference</string> + <string>your_hide_analytic</string> <string>your_portal_skin</string> <string>your_format</string> <string>your_deferred_style</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog/your_hide_analytic.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog/your_hide_analytic.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc82bb97f2ff211a001ef8fba2f9ffa148f34109 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog/your_hide_analytic.xml @@ -0,0 +1,93 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>AccountModule_viewDialogFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary.xml index 062d2f6b753e0b11f13e057042740394f4095f9b..be4b85d97c1c9143bff0e05672d74e572af0a332 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary.xml @@ -96,6 +96,7 @@ <string>your_project</string> <string>your_section_category_strict</string> <string>your_gap_list</string> + <string>your_hide_analytic</string> </list> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_hide_analytic.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_hide_analytic.xml new file mode 100644 index 0000000000000000000000000000000000000000..b3368cb2c69a9180f01d8d0e9c4939da49428bcf --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_hide_analytic.xml @@ -0,0 +1,171 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="CheckBoxField" module="Products.Formulator.StandardFields"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>If checked, accounting lines that have been split for analytic detail will be aggregated together.</string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Hide Analytical Details</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog.xml index 3dc041e3ab604c73cd68ffb339fb11bc5fc9caac..8e9defc9334bfcdbe1351c445e0ff8787a1d66b8 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog.xml @@ -89,6 +89,7 @@ <string>your_from_date</string> <string>your_at_date</string> <string>your_omit_grouping_reference</string> + <string>your_hide_analytic</string> <string>your_portal_skin</string> <string>your_format</string> <string>your_deferred_style</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog/your_hide_analytic.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog/your_hide_analytic.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc82bb97f2ff211a001ef8fba2f9ffa148f34109 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewGeneralLedgerReportDialog/your_hide_analytic.xml @@ -0,0 +1,93 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>AccountModule_viewDialogFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.xml index cfa8197bd825a973c125de960afd44bbc2b88dc4..3ec97e9c9b2b8f8a153d185f9b69ec3ef2e33c05 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.xml @@ -99,8 +99,9 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n if portal_type_filter and \\\n transaction.getPortalType() not in portal_type_list:\n continue\n - \n - if transaction.AccountingTransaction_isSourceView():\n +\n + is_source = transaction.AccountingTransaction_isSourceView()\n + if is_source:\n if payment_uid and mvt.getSourcePaymentUid() != payment_uid:\n continue\n if project_uid and mvt.getSourceProjectUid() != project_uid:\n @@ -109,6 +110,7 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n continue\n specific_reference = transaction.getSourceReference()\n mirror_section_title = transaction.getDestinationSectionTitle()\n + section_title = transaction.getSourceSectionTitle()\n else:\n if payment_uid and mvt.getDestinationPaymentUid() != payment_uid:\n continue\n @@ -118,6 +120,7 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n continue\n specific_reference = transaction.getDestinationReference()\n mirror_section_title = transaction.getSourceSectionTitle()\n + section_title = transaction.getDestinationSectionTitle()\n \n \n debit = max(brain.total_quantity, 0)\n @@ -134,18 +137,37 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n if mvt.getStartDate():\n brain_date = brain_date.toZone(mvt.getStartDate().timezone())\n \n - line_list.append(\n - Object(uid=\'new_000\',\n - total_price=brain.total_price,\n - date=brain.date,\n - Movement_getSpecificReference=specific_reference,\n - Movement_getMirrorSectionTitle=mirror_section_title,\n - debit=debit,\n - credit=credit,\n - debit_price=debit_price,\n - credit_price=credit_price,\n - Movement_getExplanationTitle=\n - mvt.hasTitle() and mvt.getTitle() or transaction.getTitle()))\n + line = Object(uid=\'new_000\',\n + total_price=brain.total_price,\n + date=brain.date,\n + Movement_getSpecificReference=specific_reference,\n + Movement_getMirrorSectionTitle=mirror_section_title,\n + section_title=section_title,\n + debit=debit,\n + credit=credit,\n + debit_price=debit_price,\n + credit_price=credit_price,\n + Movement_getExplanationTitle=\n + mvt.hasTitle() and mvt.getTitle() or transaction.getTitle())\n +\n + analytic_info = dict()\n + for analytic_column, analytic_column_title in analytic_column_list:\n + if analytic_column == \'project\':\n + if is_source:\n + analytic_info[\'project\'] = mvt.asContext(project_uid=mvt.getSourceProjectUid()).Movement_getProjectTitle()\n + else:\n + analytic_info[\'project\'] = mvt.asContext(project_uid=mvt.getDestinationProjectUid()).Movement_getProjectTitle()\n + elif analytic_column == \'function\':\n + if is_source:\n + analytic_info[\'function\'] = mvt.asContext(function_uid=mvt.getDestinationFunctionUid()).Movement_getFunctionTitle()\n + else:\n + analytic_info[\'function\'] = mvt.asContext(function_uid=mvt.getDestinationFunctionUid()).Movement_getFunctionTitle()\n + else:\n + analytic_info[analytic_column] = mvt.getProperty(analytic_column)\n +\n + line.update(analytic_info)\n + line_list.append(line)\n +\n \n context.REQUEST.set(\n \'Account_statNotGroupedAccountingTransactionList.total_debit\', total_debit)\n @@ -168,7 +190,7 @@ return line_list\n </item> <item> <key> <string>_params</string> </key> - <value> <string>selection=None, sort_on=[], node_category=None, node_category_strict_membership=None, from_date=None, selection_name=None, function=None, project_uid=None, **kw</string> </value> + <value> <string>selection=None, sort_on=[], node_category=None, node_category_strict_membership=None, from_date=None, selection_name=None, function=None, project_uid=None, analytic_column_list=(), **kw</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -188,7 +210,7 @@ return line_list\n <dictionary> <item> <key> <string>co_argcount</string> </key> - <value> <int>8</int> </value> + <value> <int>9</int> </value> </item> <item> <key> <string>co_varnames</string> </key> @@ -202,6 +224,7 @@ return line_list\n <string>selection_name</string> <string>function</string> <string>project_uid</string> + <string>analytic_column_list</string> <string>kw</string> <string>Products.PythonScripts.standard</string> <string>Object</string> @@ -230,8 +253,10 @@ return line_list\n <string>brain</string> <string>mvt</string> <string>transaction</string> + <string>is_source</string> <string>specific_reference</string> <string>mirror_section_title</string> + <string>section_title</string> <string>max</string> <string>debit</string> <string>_inplacevar_</string> @@ -239,6 +264,12 @@ return line_list\n <string>debit_price</string> <string>credit_price</string> <string>brain_date</string> + <string>line</string> + <string>dict</string> + <string>analytic_info</string> + <string>analytic_column</string> + <string>analytic_column_title</string> + <string>_write_</string> </tuple> </value> </item> @@ -259,6 +290,7 @@ return line_list\n <none/> <none/> <none/> + <tuple/> </tuple> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList.xml index 81ebd149c9199ae01fc13e6e41ebea97435c2234..2104526438fee7fc5a1fc18f6eebb27fb145a9e6 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList.xml @@ -101,6 +101,8 @@ <string>listbox_date</string> <string>listbox_credit_price</string> <string>listbox_debit_price</string> + <string>listbox_function</string> + <string>listbox_project</string> </list> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox.xml index a3ffe701d7f683dd671e9ed5a2e730eaab38d328..78fa437154d32a596cabef368e9e67a73a717ab9 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox.xml @@ -172,6 +172,14 @@ <key> <string>editable_columns</string> </key> <value> <list> + <tuple> + <string>function</string> + <string>function</string> + </tuple> + <tuple> + <string>project</string> + <string>project</string> + </tuple> <tuple> <string>date</string> <string>date</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox_function.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox_function.xml new file mode 100644 index 0000000000000000000000000000000000000000..132c50f13386cf57faace4ae9a66cbec6df10a5b --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox_function.xml @@ -0,0 +1,281 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="StringField" module="Products.Formulator.StandardFields"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>listbox_function</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>Too much input was given.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <int>20</int> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Function</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: cell.Movement_getFunctionTitle()</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox_project.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox_project.xml new file mode 100644 index 0000000000000000000000000000000000000000..8f761e0901f85b230a74840704f8f1192c9b4486 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewAccountingTransactionList/listbox_project.xml @@ -0,0 +1,281 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="StringField" module="Products.Formulator.StandardFields"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>listbox_project</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>Too much input was given.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <int>20</int> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Project</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: cell.Movement_getProjectTitle()</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList.xml index 23ddf98766ba5615507c6bd2a5edfb2a122909b2..b17284fda6847612e8762ccd9f03c0dda0077c96 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList.xml @@ -87,6 +87,8 @@ <string>listbox_total_price</string> <string>listbox_running_total_price</string> <string>listbox_date</string> + <string>listbox_credit_price</string> + <string>listbox_debit_price</string> </list> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList/listbox_credit_price.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList/listbox_credit_price.xml new file mode 100644 index 0000000000000000000000000000000000000000..2da612c1780c530ce1b75f4d02091ea9020c187d --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList/listbox_credit_price.xml @@ -0,0 +1,99 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>editable</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>listbox_credit_price</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>editable</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_view_mode_money_quantity</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList/listbox_debit_price.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList/listbox_debit_price.xml new file mode 100644 index 0000000000000000000000000000000000000000..be30167cb56a868550a92a8fc966f787f8cc27ef --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_viewNotGroupedAccountingTransactionList/listbox_debit_price.xml @@ -0,0 +1,99 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>editable</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>listbox_debit_price</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>editable</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_view_mode_money_quantity</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> 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 1ebf381739455fa387a0e22a7b851f9503d9ab30..538b95ce6168646afe5be9d96b472a82e299c4de 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 @@ -54,8 +54,37 @@ <item> <key> <string>_body</string> </key> <value> <string>"""Returns the item list of possible projects to use on accounting lines.\n +\n +This script is indented to be used on custom listfields for accounting lines, and on reports.\n """\n -return ()\n +portal = context.getPortalObject()\n +request = portal.REQUEST\n +\n +# case 1: script is used for reports, we display all project that have been used in accounting.\n +if context.getPortalType() == \'Accounting Transaction Module\':\n + getObject = portal.portal_catalog.getObject\n + search_kw=dict(portal_type=portal.getPortalAccountingMovementTypeList(),\n + group_by=(\'stock.project_uid\',))\n + section_category = request.get(\'your_section_category\',\n + portal.portal_preferences.getPreferredAccountingTransactionSectionCategory())\n + if section_category:\n + section_uid = portal.Base_getSectionUidListForSectionCategory(\n + section_category=section_category,\n + strict_membership=request.get(\'your_section_category_strict\', False))\n + search_kw[\'section_uid\'] = section_uid\n +\n + project_list = []\n + for brain in portal.portal_simulation.getInventoryList(**search_kw):\n + if brain.project_uid:\n + project = getObject(brain.project_uid)\n + project_list.append((project.getTitle(), project.getRelativeUrl(),))\n + project_list.sort(key=lambda x:x[0])\n + return [(\'\', \'\')] + 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 +# [(x.getTitle(), x.getRelativeUrl()) for x in context.project_module.searchFolder()]\n +return [(\'\', \'\')]\n </string> </value> </item> <item> @@ -91,7 +120,24 @@ return ()\n <item> <key> <string>co_varnames</string> </key> <value> - <tuple/> + <tuple> + <string>_getattr_</string> + <string>context</string> + <string>portal</string> + <string>request</string> + <string>getObject</string> + <string>dict</string> + <string>search_kw</string> + <string>section_category</string> + <string>False</string> + <string>section_uid</string> + <string>_write_</string> + <string>project_list</string> + <string>_getiter_</string> + <string>_apply_</string> + <string>brain</string> + <string>project</string> + </tuple> </value> </item> </dictionary> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml index 35352e70ffda4b30f94483ae57300bf92d5c23be..6722de902d6461ab1ac8f0afb173a216db040262 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml @@ -61,6 +61,7 @@ Base_translateString = container.Base_translateString\n \n portal_type = request[\'portal_type\']\n simulation_state = request[\'simulation_state\']\n +hide_analytic = request[\'hide_analytic\']\n at_date = request[\'at_date\'].latestTime()\n from_date = request.get(\'from_date\') or at_date.earliestTime()\n section_uid = context.Base_getSectionUidListForSectionCategory(\n @@ -76,6 +77,26 @@ precision = context.account_module.getQuantityPrecisionFromResource(currency)\n # we set the precision in request, for formatting on editable fields\n request.set(\'precision\', precision)\n \n +selection_params = dict(portal_type=portal_type,\n + section_uid=section_uid,\n + precision=precision,\n + simulation_state=simulation_state,\n + at_date=at_date,\n + from_date=from_date,\n + payment_mode=payment_mode,\n + gap_root=gap_root,\n + payment=payment)\n +\n +analytic_column_list = ()\n +if hide_analytic:\n + selection_params[\'group_by\'] = ( \'explanation_uid\',\n + \'mirror_section_uid\',\n + \'payment_uid\',\n + \'node_uid\' )\n +else:\n + analytic_column_list = context.AccountModule_getAnalyticColumnList()\n + selection_params[\'analytic_column_list\'] = analytic_column_list\n +\n selection_columns = (\n (\'specific_reference\', \'Transaction Reference\'),\n (\'date\', \'Date\'),\n @@ -83,7 +104,7 @@ selection_columns = (\n if len(portal_type) > 1:\n selection_columns += (\n (\'portal_type\', \'Journal Type\'), )\n -selection_columns += (\n +selection_columns += analytic_column_list + (\n (\'node_title\', \'Account\'),\n (\'mirror_section_title\', \'Third Party\'),\n (\'debit\', \'Debit\'),\n @@ -95,15 +116,7 @@ return [ReportSection(\n selection_name=\'journal_selection\',\n form_id=\'AccountingTransactionModule_viewJournalSection\',\n selection_columns=selection_columns,\n - selection_params=dict(portal_type=portal_type,\n - section_uid=section_uid,\n - precision=precision,\n - simulation_state=simulation_state,\n - at_date=at_date,\n - from_date=from_date,\n - payment_mode=payment_mode,\n - gap_root=gap_root,\n - payment=payment))]\n + selection_params=selection_params)]\n ]]></string> </value> @@ -151,6 +164,7 @@ return [ReportSection(\n <string>_getitem_</string> <string>portal_type</string> <string>simulation_state</string> + <string>hide_analytic</string> <string>at_date</string> <string>from_date</string> <string>context</string> @@ -160,10 +174,13 @@ return [ReportSection(\n <string>gap_root</string> <string>currency</string> <string>precision</string> + <string>dict</string> + <string>selection_params</string> + <string>analytic_column_list</string> + <string>_write_</string> <string>selection_columns</string> <string>len</string> <string>_inplacevar_</string> - <string>dict</string> </tuple> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml index ef0ed148fa86ced5f6d99a1a6d77d310c7002998..0b1256d3545879bfb27229b12a200e66061021f2 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml @@ -63,6 +63,9 @@ extra_kw = dict()\n if payment:\n extra_kw[\'payment\'] = payment\n \n +if group_by:\n + extra_kw[\'group_by\'] = group_by\n +\n account_title_cache = dict()\n def getAccountId(node_relative_url):\n if node_relative_url not in account_title_cache:\n @@ -71,6 +74,7 @@ def getAccountId(node_relative_url):\n return account_title_cache[node_relative_url]\n \n \n +# FIXME: this can be passed as node category to getMovementHistoryList\n account_in_gap_root_cache = dict()\n def isAccountInGapRoot(node_relative_url):\n if node_relative_url not in account_in_gap_root_cache:\n @@ -138,16 +142,27 @@ for brain in portal.portal_simulation.getMovementHistoryList(\n title = mvt.hasTitle() and mvt.getTitle() or \'\'\n date = None\n \n - line_list.append( Object(uid=\'new_\',\n - title=title,\n - portal_type=transaction.getTranslatedPortalType(),\n - specific_reference=specific_reference,\n - mirror_section_title=mirror_section_title,\n - node_title=getAccountId(brain.node_relative_url),\n - date=date,\n - debit=debit,\n - credit=credit))\n - \n + line = Object(uid=\'new_\',\n + title=title,\n + portal_type=transaction.getTranslatedPortalType(),\n + specific_reference=specific_reference,\n + mirror_section_title=mirror_section_title,\n + node_title=getAccountId(brain.node_relative_url),\n + date=date,\n + debit=debit,\n + credit=credit,)\n + analytic_info = dict()\n + for analytic_column, analytic_column_title in analytic_column_list:\n + if analytic_column == \'project\':\n + analytic_info[\'project\'] = brain.Movement_getProjectTitle()\n + elif analytic_column == \'function\':\n + analytic_info[\'function\'] = brain.Movement_getFunctionTitle()\n + else:\n + analytic_info[analytic_column] = mvt.getProperty(analytic_column)\n +\n + line.update(analytic_info)\n + line_list.append(line)\n +\n request.set(\n \'AccountingTransactionModule_getJournalSectionLineList.total_debit\',\n total_debit)\n @@ -166,7 +181,7 @@ return line_list\n </item> <item> <key> <string>_params</string> </key> - <value> <string>selection, at_date, from_date, portal_type, simulation_state, section_uid, payment_mode=None, payment=None, gap_root=None, **kw</string> </value> + <value> <string>selection, at_date, from_date, portal_type, simulation_state, section_uid, payment_mode=None, payment=None, gap_root=None, group_by=None, analytic_column_list=[], **kw</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -186,7 +201,7 @@ return line_list\n <dictionary> <item> <key> <string>co_argcount</string> </key> - <value> <int>9</int> </value> + <value> <int>11</int> </value> </item> <item> <key> <string>co_varnames</string> </key> @@ -201,6 +216,8 @@ return line_list\n <string>payment_mode</string> <string>payment</string> <string>gap_root</string> + <string>group_by</string> + <string>analytic_column_list</string> <string>kw</string> <string>Products.PythonScripts.standard</string> <string>Object</string> @@ -235,6 +252,10 @@ return line_list\n <string>title</string> <string>date</string> <string>None</string> + <string>line</string> + <string>analytic_info</string> + <string>analytic_column</string> + <string>analytic_column_title</string> </tuple> </value> </item> @@ -250,6 +271,8 @@ return line_list\n <none/> <none/> <none/> + <none/> + <list/> </tuple> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingLineReportReportSection.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingLineReportReportSection.xml index d87c583c1b7db578aa96ed1c0071aa5cd9140783..28007d6d4f5f27e7871835e85eda7792eb5b6af6 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingLineReportReportSection.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingLineReportReportSection.xml @@ -95,8 +95,8 @@ <string>listbox_debit</string> <string>listbox_date</string> <string>listbox_credit</string> - <string>listbox_credit_quantity</string> - <string>listbox_debit_quantity</string> + <string>listbox_credit_price</string> + <string>listbox_debit_price</string> </list> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog.xml index 01841ef6cf0c4f10d1415db2c848d3909f42922e..bd6e4b7e0bc0aa67543b52ac64bb1e3b2c93c9e8 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog.xml @@ -80,6 +80,7 @@ <string>your_section_category_strict</string> <string>your_from_date</string> <string>your_at_date</string> + <string>your_hide_analytic</string> <string>your_portal_skin</string> <string>your_format</string> <string>your_deferred_style</string> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog/your_hide_analytic.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog/your_hide_analytic.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc82bb97f2ff211a001ef8fba2f9ffa148f34109 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog/your_hide_analytic.xml @@ -0,0 +1,93 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>your_hide_analytic</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>AccountModule_viewDialogFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalSection/listbox.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalSection/listbox.xml index b973a8882d59f522063bc79129c7bd87ae3df6c7..921586724952152b0def968c524d73807e7a5b3b 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalSection/listbox.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalSection/listbox.xml @@ -316,6 +316,10 @@ <key> <string>alternate_name</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>anchor</string> </key> + <value> <int>0</int> </value> + </item> <item> <key> <string>columns</string> </key> <value> @@ -369,6 +373,12 @@ <key> <string>description</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>display_style_list</string> </key> + <value> + <list/> + </value> + </item> <item> <key> <string>domain_root_list</string> </key> <value> @@ -420,6 +430,10 @@ <key> <string>hidden</string> </key> <value> <int>0</int> </value> </item> + <item> + <key> <string>hide_rows_on_no_search_criterion</string> </key> + <value> <int>0</int> </value> + </item> <item> <key> <string>lines</string> </key> <value> <int>20</int> </value> @@ -460,6 +474,10 @@ <key> <string>report_tree</string> </key> <value> <int>0</int> </value> </item> + <item> + <key> <string>row_css_method</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>search</string> </key> <value> <int>0</int> </value> @@ -506,6 +524,12 @@ <key> <string>title</string> </key> <value> <string>Transactions</string> </value> </item> + <item> + <key> <string>untranslatable_columns</string> </key> + <value> + <list/> + </value> + </item> <item> <key> <string>url_columns</string> </key> <value> @@ -521,11 +545,8 @@ <record id="2" aka="AAAAAAAAAAI="> <pickle> <tuple> - <tuple> - <string>Products.Formulator.MethodField</string> - <string>Method</string> - </tuple> - <none/> + <global name="Method" module="Products.Formulator.MethodField"/> + <tuple/> </tuple> </pickle> <pickle> @@ -540,11 +561,8 @@ <record id="3" aka="AAAAAAAAAAM="> <pickle> <tuple> - <tuple> - <string>Products.Formulator.MethodField</string> - <string>Method</string> - </tuple> - <none/> + <global name="Method" module="Products.Formulator.MethodField"/> + <tuple/> </tuple> </pickle> <pickle> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Movement_getFunctionTitle.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Movement_getFunctionTitle.xml new file mode 100644 index 0000000000000000000000000000000000000000..498fe849ad478e095115377ff886f860213d9ea6 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Movement_getFunctionTitle.xml @@ -0,0 +1,138 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>movement = context.getObject()\n +function_uid = context.function_uid\n +\n +title_dict = container.REQUEST.get(\n + \'Movement_getFunctionTitle.function_title_dict\') or dict()\n +if function_uid in title_dict:\n + return title_dict[function_uid] \n +\n +if movement.getSourceFunctionUid() == function_uid:\n + return movement.getSourceFunctionTitle()\n +return movement.getDestinationFunctionTitle()\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>errors</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>func_code</string> </key> + <value> + <object> + <klass> + <global name="FuncCode" module="Shared.DC.Scripts.Signature"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>co_argcount</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>_getattr_</string> + <string>context</string> + <string>movement</string> + <string>function_uid</string> + <string>container</string> + <string>dict</string> + <string>title_dict</string> + <string>_getitem_</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Movement_getFunctionTitle</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Movement_getProjectTitle.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Movement_getProjectTitle.xml new file mode 100644 index 0000000000000000000000000000000000000000..f4cd9cc26946c222bbf8e05fe0fcd36fde9119fb --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Movement_getProjectTitle.xml @@ -0,0 +1,138 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>project_uid = context.project_uid\n +\n +title_dict = container.REQUEST.get(\n + \'Movement_getProjectTitle.project_title_dict\') or dict()\n +if project_uid in title_dict:\n + return title_dict[project_uid]\n +\n +movement = context.getObject()\n +if movement.getSourceProjectUid() == project_uid:\n + return movement.getSourceProjectTitle()\n +return movement.getDestinationProjectTitle()\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>errors</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>func_code</string> </key> + <value> + <object> + <klass> + <global name="FuncCode" module="Shared.DC.Scripts.Signature"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>co_argcount</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>_getattr_</string> + <string>context</string> + <string>project_uid</string> + <string>container</string> + <string>dict</string> + <string>title_dict</string> + <string>_getitem_</string> + <string>movement</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Movement_getProjectTitle</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> 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 033e3aa8fe72db7df7c7d58bf1434e42758e615f..923168d8634d91e543a8700d2913b6a9549cb8fd 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 @@ -58,11 +58,12 @@ from Products.ERP5Type.Message import translateString\n from Products.ERP5Type.Log import log\n portal = context.getPortalObject()\n +request = portal.REQUEST\n params = portal.ERP5Accounting_getParams(selection_name=selection_name)\n \n if params.get(\'precision\', None) is not None:\n # listbox editable float fields uses request/precision to format the value.\n - context.REQUEST.set(\'precision\', params[\'precision\'])\n + request.set(\'precision\', params[\'precision\'])\n \n if not from_date:\n from_date = portal.portal_preferences\\\n @@ -87,7 +88,6 @@ if node_category:\n if not \'parent_portal_type\' in params:\n params.setdefault(\'portal_type\', portal.getPortalAccountingMovementTypeList())\n \n -\n # Create the related accouting line list\n new_result = []\n net_balance = 0.0\n @@ -138,8 +138,10 @@ if from_date or is_pl_account:\n period_openning_balance = 0\n else:\n period_openning_balance = getInventoryAssetPrice(\n - to_date=period_start_date,\n + to_date=min(period_start_date,\n + from_date),\n **get_inventory_kw)\n +\n # then all movement between period_start_date and from_date\n previous_total_debit = getInventoryAssetPrice(omit_output=True,\n from_date=period_start_date,\n @@ -152,6 +154,9 @@ if from_date or is_pl_account:\n \n if previous_total_credit != 0:\n previous_total_credit = - previous_total_credit\n +\n + if \'group_by\' in kw:\n + params[\'group_by\'] = kw[\'group_by\']\n \n # Show the previous balance if not empty\n if previous_total_credit != 0 or previous_total_debit != 0:\n @@ -175,6 +180,8 @@ if from_date or is_pl_account:\n Movement_getMirrorSectionTitle=\'\',\n Movement_getNodeGapId=\'\',\n Movement_getExplanationUrl=lambda **kw: \'\',\n + Movement_getFunctionTitle=lambda: \'\',\n + Movement_getProjectTitle=lambda: \'\',\n Node_statAccountingBalance=\'\',\n getTranslatedSimulationStateTitle=\'\',\n )\n @@ -264,6 +271,7 @@ return portal.portal_simulation.getMovementHistoryList(\n <string>_getattr_</string> <string>context</string> <string>portal</string> + <string>request</string> <string>params</string> <string>None</string> <string>_getitem_</string> @@ -281,6 +289,7 @@ return portal.portal_simulation.getMovementHistoryList(\n <string>getInventoryAssetPrice</string> <string>period_openning_balance</string> <string>_apply_</string> + <string>min</string> <string>True</string> <string>Products.ERP5Type.Document</string> <string>newTempBase</string> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 15448f161f43d191e5b31ce05ef9011bc518806b..458361b90b0681303c98bfe5f2e6c8de59229aa3 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -1261 \ No newline at end of file +1263 \ No newline at end of file