From 35a76e45c98d6c8ac57c1983bb2b88969b36fab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 2 Dec 2016 03:44:41 +0000 Subject: [PATCH] accounting: restore mirror_section_title columns in GL and Account statement Feedback after 8c313674d65648d48639a2eff3f7d5a9be5be5fe and 72dfb2c4034251013bb2b96b547ca65cee8fd496 from many people where that they really miss this column in default print mode (having it only in export mode was not enough) and that they do not need need modification_date. --- ...le_getAccountStatementReportSectionList.py | 2 +- ...odule_getGeneralLedgerReportSectionList.py | 2 +- product/ERP5/tests/testAccountingReports.py | 33 +++++++++---------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.py index 65f09d1d05..5ed103249e 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.py +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.py @@ -100,6 +100,7 @@ request.set('analytic_column_list', analytic_column_list) # for Movement_getExpl selection_columns = ( ('date', 'Operation Date'), ('Movement_getSpecificReference', 'Transaction Reference'), + ('mirror_section_title', 'Third Party'), ('Movement_getExplanationTitleAndAnalytics', 'Title\nReference and Analytics' if analytic_column_list else 'Title\nReference'), ) if len(section_uid) > 1: @@ -110,7 +111,6 @@ selection_columns += ( ('running_total_price', 'Running Balance'), ('grouping_reference', 'Grouping Reference'), ('grouping_date', 'Grouping Date'), - ('modification_date', 'Modification Date'), ('getTranslatedSimulationStateTitle', 'State'), ) diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.py index 541d47d31a..107cb476c3 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.py +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.py @@ -119,13 +119,13 @@ request.set('analytic_column_list', analytic_column_list) # for Movement_getExpl account_columns = ( ('date', 'Operation Date'), ('Movement_getSpecificReference', 'Transaction Reference'), + ('mirror_section_title', 'Third Party'), ('Movement_getExplanationTitleAndAnalytics', 'Title\nReference and Analytics' if analytic_column_list else 'Title\nReference'), ('debit_price', 'Debit'), ('credit_price', 'Credit'), ('running_total_price', 'Running Balance'), ('grouping_reference', 'Grouping Reference'), ('grouping_date', 'Grouping Date'), - ('modification_date', 'Modification Date'), ('getTranslatedSimulationStateTitle', 'State'), ) # export mode have a different layout diff --git a/product/ERP5/tests/testAccountingReports.py b/product/ERP5/tests/testAccountingReports.py index 9750dd52ac..eb4c842c34 100644 --- a/product/ERP5/tests/testAccountingReports.py +++ b/product/ERP5/tests/testAccountingReports.py @@ -927,15 +927,15 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): # test columns values line = data_line_list[0] self.assertEqual(line.column_id_list, - ['date', 'Movement_getSpecificReference', + ['date', 'Movement_getSpecificReference', 'mirror_section_title', 'Movement_getExplanationTitleAndAnalytics', 'debit_price', 'credit_price', 'running_total_price', 'grouping_reference', - 'grouping_date', 'modification_date', - 'getTranslatedSimulationStateTitle']) + 'grouping_date', 'getTranslatedSimulationStateTitle']) self.checkLineProperties(data_line_list[0], Movement_getSpecificReference='1', date=DateTime(2006, 2, 1), + mirror_section_title='Client 1', Movement_getExplanationTitleAndAnalytics='Transaction 1\nref1', debit_price=100, credit_price=0, @@ -944,6 +944,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): self.checkLineProperties(data_line_list[1], Movement_getSpecificReference='2', date=DateTime(2006, 2, 1, 0, 1), + mirror_section_title='Client 1', Movement_getExplanationTitleAndAnalytics='Transaction 2\nref2', debit_price=0, credit_price=200, @@ -1205,16 +1206,16 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): data_line_list = [l for l in line_list if l.isDataLine()] # report layout - self.assertEqual( ['date', 'Movement_getSpecificReference', + self.assertEqual( ['date', 'Movement_getSpecificReference', 'mirror_section_title', 'Movement_getExplanationTitleAndAnalytics', 'debit_price', 'credit_price', 'running_total_price', 'grouping_reference', - 'grouping_date', 'modification_date', - 'getTranslatedSimulationStateTitle'], + 'grouping_date', 'getTranslatedSimulationStateTitle'], data_line_list[0].column_id_list) self.assertEqual(1, len(data_line_list)) self.checkLineProperties(data_line_list[0], Movement_getSpecificReference='2', + mirror_section_title='Client 2', Movement_getExplanationTitleAndAnalytics='Grouped after period\nref2', grouping_reference='B', grouping_date=DateTime(2006, 3, 2), @@ -1706,7 +1707,6 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): Movement_getExplanationTitleAndAnalytics=None, grouping_date=None, grouping_reference=None, - modification_date='', debit_price=300, credit_price=21, running_total_price=279) @@ -3877,16 +3877,16 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): AccountModule_viewGeneralLedgerReport.your_currency.get_value('default')) # report layout - self.assertEqual( ['date', 'Movement_getSpecificReference', + self.assertEqual( ['date', 'Movement_getSpecificReference', 'mirror_section_title', 'Movement_getExplanationTitleAndAnalytics', 'debit_price', 'credit_price', 'running_total_price', 'grouping_reference', - 'grouping_date', 'modification_date', - 'getTranslatedSimulationStateTitle'], + 'grouping_date', 'getTranslatedSimulationStateTitle'], data_line_list[0].column_id_list) self.assertEqual(2, len(data_line_list)) self.checkLineProperties(data_line_list[0], Movement_getSpecificReference='1', + mirror_section_title='Client 1', Movement_getExplanationTitleAndAnalytics='Transaction 1\nref1', date=DateTime(2006, 2, 1), debit_price=0, credit_price=100, running_total_price=-100, ) @@ -5228,10 +5228,10 @@ DT, b, P2 - Project 2''', data_line_list = [l for l in line_list if l.isDataLine()] self.assertEqual( ['date', 'Movement_getSpecificReference', - 'Movement_getExplanationTitleAndAnalytics', 'debit_price', - 'credit_price', 'running_total_price', 'grouping_reference', - 'grouping_date', 'modification_date', - 'getTranslatedSimulationStateTitle'], + 'mirror_section_title', 'Movement_getExplanationTitleAndAnalytics', + 'debit_price', 'credit_price', 'running_total_price', + 'grouping_reference', 'grouping_date', + 'getTranslatedSimulationStateTitle'], data_line_list[0].column_id_list) self.checkLineProperties(data_line_list[0], @@ -5282,11 +5282,10 @@ DT, b, P2 - Project 2''', line_list = self.getListBoxLineList(report_section_list[0]) data_line_list = [l for l in line_list if l.isDataLine()] - self.assertEqual( ['date', 'Movement_getSpecificReference', + self.assertEqual( ['date', 'Movement_getSpecificReference', 'mirror_section_title', 'Movement_getExplanationTitleAndAnalytics', 'debit_price', 'credit_price', 'running_total_price', 'grouping_reference', - 'grouping_date', 'modification_date', - 'getTranslatedSimulationStateTitle'], + 'grouping_date', 'getTranslatedSimulationStateTitle'], data_line_list[0].column_id_list) # receivable account self.assertEqual(1, len(data_line_list)) -- 2.30.9