diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_export.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_export.xml index d175c1f3aa3e382bf93a7142618ca98314f099d2..18e32f1f181bdffb4395896d81e7f07869135f02 100644 --- a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_export.xml +++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_export.xml @@ -77,7 +77,7 @@ <key> <string>text</string> </key> <value> <string encoding="cdata"><![CDATA[ -string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= +string:${object_url}/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= ]]></string> </value> </item> diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_report.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_report.xml index 25a59c5d24737a6b6878cfc7f821d588c5e32ad2..72516632c9299b7bacc7c76146154d62baf9367b 100644 --- a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_report.xml +++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_report.xml @@ -75,7 +75,7 @@ <dictionary> <item> <key> <string>text</string> </key> - <value> <string>string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}</string> </value> + <value> <string>string:${object_url}/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_export.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_export.xml index 62bd721355c2312befbc038527573b31df9d4423..1bfbb55fbcdf70acb6db13ed8e800ec4a23c0217 100644 --- a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_export.xml +++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_export.xml @@ -77,7 +77,7 @@ <key> <string>text</string> </key> <value> <string encoding="cdata"><![CDATA[ -string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= +string:${object_url}/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= ]]></string> </value> </item> diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_report.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_report.xml index 4b732faabf87a2abe7775e738a5c8002b26ac55f..6f038a9533dbb5ba09ddaf7b07fc6b636b6d681a 100644 --- a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_report.xml +++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/general_ledger_report.xml @@ -75,7 +75,7 @@ <dictionary> <item> <key> <string>text</string> </key> - <value> <string>string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}</string> </value> + <value> <string>string:${object_url}/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index b46152094250df5445d7e3c5eac6480054fd351d..585db5499ee4646ea1e42a1dd07ed2737760e7c9 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -1557 \ No newline at end of file +1558 \ No newline at end of file diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_start_date.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_start_date.xml index 5f1fe5205e66530f8a87dbc49f3eaac92310f21f..7d2ff3f25f3ebf46a56aaa86c41f281dcdd2e44d 100644 --- a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_start_date.xml +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_start_date.xml @@ -9,7 +9,9 @@ <item> <key> <string>delegated_list</string> </key> <value> - <list/> + <list> + <string>editable</string> + </list> </value> </item> <item> @@ -50,6 +52,12 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -69,6 +77,10 @@ <key> <string>values</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string>my_start_date</string> </value> @@ -87,4 +99,17 @@ </dictionary> </pickle> </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: cell.Base_checkPermission(cell.getRelativeUrl(), "Modify portal content")</string> </value> + </item> + </dictionary> + </pickle> + </record> </ZopeData> diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_stop_date.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_stop_date.xml index 9b1305c07729368830755ec1cfd321737e1f1455..0e1364e9d2a721a962fd1d05c89044c24d7ef556 100644 --- a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_stop_date.xml +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_stop_date.xml @@ -9,7 +9,9 @@ <item> <key> <string>delegated_list</string> </key> <value> - <list/> + <list> + <string>editable</string> + </list> </value> </item> <item> @@ -50,6 +52,12 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -69,6 +77,10 @@ <key> <string>values</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string>my_stop_date</string> </value> @@ -87,4 +99,17 @@ </dictionary> </pickle> </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: cell.Base_checkPermission(cell.getRelativeUrl(), "Modify portal content")</string> </value> + </item> + </dictionary> + </pickle> + </record> </ZopeData> diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_title.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_title.xml index ef29be40b492825d0273986d1af0f731d51132e7..dabe1b12f8563e3c443c3dca3ea0c9942180fd8a 100644 --- a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_title.xml +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_viewDetails/listbox_title.xml @@ -9,7 +9,9 @@ <item> <key> <string>delegated_list</string> </key> <value> - <list/> + <list> + <string>editable</string> + </list> </value> </item> <item> @@ -56,6 +58,12 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -75,6 +83,10 @@ <key> <string>values</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string>my_title</string> </value> @@ -124,37 +136,37 @@ <item> <key> <string>ampm</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> <item> <key> <string>day</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> </value> </item> <item> <key> <string>hour</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent> </value> </item> <item> <key> <string>minute</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent> </value> </item> <item> <key> <string>month</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent> </value> </item> <item> <key> <string>year</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAk=</string> </persistent> </value> </item> </dictionary> @@ -227,6 +239,19 @@ </pickle> </record> <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: cell.Base_checkPermission(cell.getRelativeUrl(), "Modify portal content")</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> <pickle> <tuple> <tuple> @@ -489,7 +514,7 @@ </dictionary> </pickle> </record> - <record id="4" aka="AAAAAAAAAAQ="> + <record id="5" aka="AAAAAAAAAAU="> <pickle> <tuple> <tuple> @@ -744,7 +769,7 @@ </dictionary> </pickle> </record> - <record id="5" aka="AAAAAAAAAAU="> + <record id="6" aka="AAAAAAAAAAY="> <pickle> <tuple> <tuple> @@ -999,7 +1024,7 @@ </dictionary> </pickle> </record> - <record id="6" aka="AAAAAAAAAAY="> + <record id="7" aka="AAAAAAAAAAc="> <pickle> <tuple> <tuple> @@ -1254,7 +1279,7 @@ </dictionary> </pickle> </record> - <record id="7" aka="AAAAAAAAAAc="> + <record id="8" aka="AAAAAAAAAAg="> <pickle> <tuple> <tuple> @@ -1509,7 +1534,7 @@ </dictionary> </pickle> </record> - <record id="8" aka="AAAAAAAAAAg="> + <record id="9" aka="AAAAAAAAAAk="> <pickle> <tuple> <tuple> diff --git a/bt5/erp5_base/bt/revision b/bt5/erp5_base/bt/revision index ddac0493114f442981539b57c9a73b066fd4ba34..bb5b992331e711599a991669642d04fc1e2e82db 100644 --- a/bt5/erp5_base/bt/revision +++ b/bt5/erp5_base/bt/revision @@ -1 +1 @@ -1059 \ No newline at end of file +1060 diff --git a/bt5/erp5_configurator_standard_trade_template/PathTemplateItem/portal_rules/new_delivery_simulation_rule/journal_tester.xml b/bt5/erp5_configurator_standard_trade_template/PathTemplateItem/portal_rules/new_delivery_simulation_rule/journal_tester.xml new file mode 100644 index 0000000000000000000000000000000000000000..31e4220e1a3d244669b3ab6909cf0e82e79a57f2 --- /dev/null +++ b/bt5/erp5_configurator_standard_trade_template/PathTemplateItem/portal_rules/new_delivery_simulation_rule/journal_tester.xml @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category Membership Divergence Tester" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_identity_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_range_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>journal_tester</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category Membership Divergence Tester</string> </value> + </item> + <item> + <key> <string>tested_property</string> </key> + <value> + <tuple> + <string>journal</string> + </tuple> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>journal divergence tester</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_configurator_standard_trade_template/PathTemplateItem/portal_rules/new_order_root_simulation_rule/journal_tester.xml b/bt5/erp5_configurator_standard_trade_template/PathTemplateItem/portal_rules/new_order_root_simulation_rule/journal_tester.xml new file mode 100644 index 0000000000000000000000000000000000000000..31e4220e1a3d244669b3ab6909cf0e82e79a57f2 --- /dev/null +++ b/bt5/erp5_configurator_standard_trade_template/PathTemplateItem/portal_rules/new_order_root_simulation_rule/journal_tester.xml @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category Membership Divergence Tester" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_identity_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_range_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>journal_tester</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category Membership Divergence Tester</string> </value> + </item> + <item> + <key> <string>tested_property</string> </key> + <value> + <tuple> + <string>journal</string> + </tuple> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>journal divergence tester</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_configurator_standard_trade_template/bt/revision b/bt5/erp5_configurator_standard_trade_template/bt/revision index 56a6051ca2b02b04ef92d5150c9ef600403cb1de..e440e5c842586965a7fb77deda2eca68612b1f53 100644 --- a/bt5/erp5_configurator_standard_trade_template/bt/revision +++ b/bt5/erp5_configurator_standard_trade_template/bt/revision @@ -1 +1 @@ -1 \ No newline at end of file +3 \ No newline at end of file diff --git a/bt5/erp5_project/PathTemplateItem/portal_deliveries/task_report_builder/category_movement_group_on_delivery.xml b/bt5/erp5_project/PathTemplateItem/portal_deliveries/task_report_builder/category_movement_group_on_delivery.xml index 96f310ed737461fefc68e8d40362c8bcb2674598..23c2bf16111ac9ee9d1100404bdc7114b7c3be44 100644 --- a/bt5/erp5_project/PathTemplateItem/portal_deliveries/task_report_builder/category_movement_group_on_delivery.xml +++ b/bt5/erp5_project/PathTemplateItem/portal_deliveries/task_report_builder/category_movement_group_on_delivery.xml @@ -41,6 +41,7 @@ <string>destination</string> <string>source_section</string> <string>destination_section</string> + <string>journal</string> <string>source_project</string> <string>destination_project</string> <string>source_payment</string> diff --git a/bt5/erp5_project/bt/revision b/bt5/erp5_project/bt/revision index 7e0a9d2ab79813cf0e9d5e837e7dfc8fd02de1b6..e7fd4bfbe1ea64c596fb7c45397fd6d57f73ec9c 100644 --- a/bt5/erp5_project/bt/revision +++ b/bt5/erp5_project/bt/revision @@ -1 +1 @@ -837 \ No newline at end of file +838 \ No newline at end of file diff --git a/bt5/erp5_research_item/SkinTemplateItem/portal_skins/erp5_research_item/ResearchItemModule_callResearchSummaryReport.xml b/bt5/erp5_research_item/SkinTemplateItem/portal_skins/erp5_research_item/ResearchItemModule_callResearchSummaryReport.xml index 2af5924c528a65a89712dc96756a9b1d97f103e5..f79499d7d753371ea8c616afeb06d388b8474e44 100644 --- a/bt5/erp5_research_item/SkinTemplateItem/portal_skins/erp5_research_item/ResearchItemModule_callResearchSummaryReport.xml +++ b/bt5/erp5_research_item/SkinTemplateItem/portal_skins/erp5_research_item/ResearchItemModule_callResearchSummaryReport.xml @@ -63,7 +63,6 @@ if multiplier is None:\n \n portal = context.getPortalObject()\n \n -portal = context.getPortalObject()\n simulation_state_set = set(simulation_state_list)\n # We will use inventory API in order to find all quantities\n before_confirmed_task_state_set = set(portal.getPortalPlannedOrderStateList() + \\\n @@ -150,14 +149,18 @@ column_url_script_list = []\n for item_url in item_title_dict.keys():\n column_url_script_list.append((item_url, "getColumnUrl"))\n \n -context = context.asContext(column_list=column_list,\n - at_date=at_date,\n - from_date=from_date,\n - simulation_state_list=simulation_state_list,\n - column_url_script_list=column_url_script_list,\n - journal=journal,\n - multiplier=multiplier,\n - listbox_line_list=listbox_line_list)\n +context_kw = {}\n +context_kw.update(column_list=column_list,\n + at_date=at_date,\n + from_date=from_date,\n + simulation_state_list=simulation_state_list,\n + column_url_script_list=column_url_script_list,\n + journal=journal,\n + multiplier=multiplier,\n + listbox_line_list=listbox_line_list)\n +context = context.getObject().asContext(**context_kw)\n +if batch_mode:\n + return context\n return context.ResearchItemModule_viewResearchSummaryReportData()\n @@ -165,7 +168,7 @@ return context.ResearchItemModule_viewResearchSummaryReportData()\n </item> <item> <key> <string>_params</string> </key> - <value> <string>at_date=None, from_date=None, simulation_state_list=None, journal=None, multiplier=None, **kw</string> </value> + <value> <string>at_date=None, from_date=None, simulation_state_list=None, journal=None, multiplier=None, batch_mode=False, **kw</string> </value> </item> <item> <key> <string>id</string> </key> diff --git a/bt5/erp5_research_item/TestTemplateItem/portal_components/test.erp5.testResearchItemSummaryReport.py b/bt5/erp5_research_item/TestTemplateItem/portal_components/test.erp5.testResearchItemSummaryReport.py new file mode 100644 index 0000000000000000000000000000000000000000..980f70557da3046d03df05dd132035a9ce112636 --- /dev/null +++ b/bt5/erp5_research_item/TestTemplateItem/portal_components/test.erp5.testResearchItemSummaryReport.py @@ -0,0 +1,168 @@ +############################################################################## +# +# Copyright (c) 2002-2013 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + +from DateTime import DateTime +from Products.ERP5.tests.testTaskReporting import TestTaskReportingMixin + +class TestResearchItemSummaryReport(TestTaskReportingMixin): + """ + Test Research Items Reports + """ + + def getTitle(self): + return "ResearchItemSummaryReport" + + def afterSetUp(self): + """Make sure to initialize needed categories + """ + super(TestResearchItemSummaryReport, self).afterSetUp() + journal_base_category = self.portal.portal_categories.journal + for category_id in ("operation", "research"): + if not journal_base_category.has_key(category_id): + journal_base_category.newContent( + portal_type='Category', title=category_id.title(), + reference=category_id, id=category_id) + + # create items + if not self.portal.research_item_module.has_key('Item_1'): + self.portal.research_item_module.newContent(title="Item_1", + id="Item_1", portal_type="Research Item") + if not self.portal.research_item_module.has_key('Item_2'): + self.portal.research_item_module.newContent(title="Item_2", + id="Item_2", portal_type="Research Item") + + def getBusinessTemplateList(self): + """ + Tuple of Business Templates we need to install + """ + bt_list = super(TestResearchItemSummaryReport, self).getBusinessTemplateList() + return list(bt_list) + ["erp5_research_item"] + + def _makeOneTask(self, **kw): + task =super(TestResearchItemSummaryReport, self)._makeOneTask( + resource='product_module/development', + source_section='organisation_module/Organisation_1', + destination='organisation_module/Organisation_2', + destination_section='organisation_module/Organisation_2', + source_project='project_module/Project_1/Line_1', + start_date=DateTime('2013/01/10'), + stop_date=DateTime('2013/02/15'), + journal="research", + simulation_state="confirmed", + **kw) + return task + + def testResearchSummaryReport(self): + """ + Test research summary report available on item research module + """ + report = self.portal.research_item_module.ResearchItemModule_callResearchSummaryReport + def callReport(): + return report(from_date=from_date, at_date=at_date, batch_mode=True, + journal="research", simulation_state_list=["confirmed"]) + def getDataResult(result): + data_list = [] + column_id_list = [x[0] for x in result.column_list] + self.assertEquals(column_id_list[0], "source_title") + self.assertEquals(column_id_list[-1], "total") + column_id_list.pop(0) + column_id_list.pop(-1) + column_id_list.sort() + column_id_list = ["source_title"] + column_id_list + ["total"] + for line in result.listbox_line_list: + line_data = [] + for property_name in column_id_list: + line_data.append(line.getProperty(property_name)) + data_list.append(line_data) + data_list.sort(key=lambda x: x[0]) + column_list = [x for x in result.column_list] + column_list.sort(key=lambda x: column_id_list.index(x[0])) + return [x[1] for x in column_list], data_list + + # First call it when it is empty + from_date = DateTime("2013/01/01") + at_date = DateTime("2014/01/01") + result = callReport() + # Initially we should have only one line for an empty total + self.assertEquals((["Worker", "Total"], + [["Total", None]]), + getDataResult(result)) + + # Then create one task with no item, see if we it is displayed in the report + self._makeOneTask( + title='Task 1', + task_line_quantity=3, + source='person_module/Person_1', + ) + result = callReport() + self.assertEquals((["Worker", "undefined", "Total"], + [["Person_1", 3, 3], + ["Total", 3, 3]]), + getDataResult(result)) + + # Then create one task with item, see if we it is displayed in the report + self._makeOneTask( + title='Task 2', + task_line_quantity=5.2, + source='person_module/Person_2', + line_aggregate_relative_url='research_item_module/Item_1', + ) + result = callReport() + self.assertEquals((["Worker", "undefined", "Item_1", "Total"], + [["Person_1", 3, None, 3], + ["Person_2", None, 5.2, 5.2], + ["Total", 3, 5.2, 8.2]]), + getDataResult(result)) + + # 3 additional tasks to check sums + self._makeOneTask( + title='Task 3', + task_line_quantity=2.4, + source='person_module/Person_2', + line_aggregate_relative_url='research_item_module/Item_1', + ) + self._makeOneTask( + title='Task 4', + task_line_quantity=1.7, + source='person_module/Person_1', + line_aggregate_relative_url='research_item_module/Item_2', + ) + self._makeOneTask( + title='Task 5', + task_line_quantity=0.9, + source='person_module/Person_2', + line_aggregate_relative_url='research_item_module/Item_2', + ) + result = callReport() + self.assertEquals((["Worker", "undefined", "Item_1", "Item_2", "Total"], + [["Person_1", 3, None, 1.7, 4.7], + ["Person_2", None, 7.6, 0.9, 8.5], + ["Total", 3, 7.6, 2.6, 13.2]]), + getDataResult(result)) + + + diff --git a/bt5/erp5_research_item/TestTemplateItem/portal_components/test.erp5.testResearchItemSummaryReport.xml b/bt5/erp5_research_item/TestTemplateItem/portal_components/test.erp5.testResearchItemSummaryReport.xml new file mode 100644 index 0000000000000000000000000000000000000000..97230467c67734543419d4e67471462eee065a3b --- /dev/null +++ b/bt5/erp5_research_item/TestTemplateItem/portal_components/test.erp5.testResearchItemSummaryReport.xml @@ -0,0 +1,150 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Test Component" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_recorded_property_dict</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>testResearchItemSummaryReport</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>test.erp5.testResearchItemSummaryReport</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Test Component</string> </value> + </item> + <item> + <key> <string>sid</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>text_content_error_message</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>text_content_warning_message</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>erp5</string> </value> + </item> + <item> + <key> <string>workflow_history</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary> + <item> + <key> <string>component_validation_workflow</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> + </pickle> + <pickle> + <tuple> + <none/> + <list> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> <string>validate</string> </value> + </item> + <item> + <key> <string>actor</string> </key> + <value> <string>seb</string> </value> + </item> + <item> + <key> <string>comment</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>time</string> </key> + <value> + <object> + <klass> + <global name="DateTime" module="DateTime.DateTime"/> + </klass> + <tuple> + <none/> + </tuple> + <state> + <tuple> + <float>1385030033.93</float> + <string>GMT+1</string> + </tuple> + </state> + </object> + </value> + </item> + <item> + <key> <string>validation_state</string> </key> + <value> <string>validated</string> </value> + </item> + </dictionary> + </list> + </tuple> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_research_item/bt/revision b/bt5/erp5_research_item/bt/revision index 62f9457511f879886bb7728c986fe10b0ece6bcb..301160a93062df23030a69f4b5e4d9bf71866ee9 100644 --- a/bt5/erp5_research_item/bt/revision +++ b/bt5/erp5_research_item/bt/revision @@ -1 +1 @@ -6 \ No newline at end of file +8 \ No newline at end of file diff --git a/bt5/erp5_research_item/bt/template_test_id_list b/bt5/erp5_research_item/bt/template_test_id_list new file mode 100644 index 0000000000000000000000000000000000000000..b558b2d80d4381d3be8ab790603616d4cdcfadc4 --- /dev/null +++ b/bt5/erp5_research_item/bt/template_test_id_list @@ -0,0 +1 @@ +test.erp5.testResearchItemSummaryReport \ No newline at end of file diff --git a/bt5/erp5_research_item/bt/test_dependency_list b/bt5/erp5_research_item/bt/test_dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..72f980091a5325e35d0de11a1afaa09fbfd39684 --- /dev/null +++ b/bt5/erp5_research_item/bt/test_dependency_list @@ -0,0 +1,5 @@ +erp5_full_text_myisam_catalog +erp5_simulation +erp5_configurator_standard_trade_template +erp5_simulation_test +erp5_project diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalTradeCondition_view/listbox.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalTradeCondition_view/listbox.xml index 22679ecbca371131645d47c62b71ac5eb4bfc82d..b4d97375a7981dc1a67193cafe2117b486f592a5 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalTradeCondition_view/listbox.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalTradeCondition_view/listbox.xml @@ -85,6 +85,26 @@ <string>resource_title</string> <string>Product or Service</string> </tuple> + <tuple> + <string>priced_quantity</string> + <string>Priced Quantity</string> + </tuple> + <tuple> + <string>base_price</string> + <string>Base Price</string> + </tuple> + <tuple> + <string>additional_price</string> + <string>Additional Price</string> + </tuple> + <tuple> + <string>discount_ratio</string> + <string>Discount Ratio</string> + </tuple> + <tuple> + <string>surcharge_ratio</string> + <string>Surcharge Ratio</string> + </tuple> </list> </value> </item> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/listbox.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/listbox.xml index cb88eecfd394c1af159d70327391495edd571582..764899b1e7b2b854c68ee4727b7ae2e3aa63be34 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/listbox.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/listbox.xml @@ -85,6 +85,26 @@ <string>resource_title</string> <string>Product or Service</string> </tuple> + <tuple> + <string>priced_quantity</string> + <string>Priced Quantity</string> + </tuple> + <tuple> + <string>base_price</string> + <string>Base Price</string> + </tuple> + <tuple> + <string>additional_price</string> + <string>Additional Price</string> + </tuple> + <tuple> + <string>discount_ratio</string> + <string>Discount Ratio</string> + </tuple> + <tuple> + <string>surcharge_ratio</string> + <string>Surcharge Ratio</string> + </tuple> </list> </value> </item> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/listbox.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/listbox.xml index 1f55a715675e8aefaeaa1f8a5726f5ebe0412454..78fa30c26bead6cd59a49388e5919287b1123405 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/listbox.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/listbox.xml @@ -85,6 +85,26 @@ <string>resource_title</string> <string>Product or Service</string> </tuple> + <tuple> + <string>priced_quantity</string> + <string>Priced Quantity</string> + </tuple> + <tuple> + <string>base_price</string> + <string>Base Price</string> + </tuple> + <tuple> + <string>additional_price</string> + <string>Additional Price</string> + </tuple> + <tuple> + <string>discount_ratio</string> + <string>Discount Ratio</string> + </tuple> + <tuple> + <string>surcharge_ratio</string> + <string>Surcharge Ratio</string> + </tuple> </list> </value> </item> diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 66dae0a0390439afdecd2ea7d5c1eebcf234caf5..3352d4fe154923515baa863093a5ed9d64df320f 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -1175 \ No newline at end of file +1176 \ No newline at end of file diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index cf7ca505e872d74c12ee3b275f4cc36da020b7ff..205aa6e229ba28867177ed9768a753b845ca0ac0 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -5784,7 +5784,9 @@ Business Template is a set of definitions, such as skins, portal types and categ """ missing_dep_list = self.getMissingDependencyList() if len(missing_dep_list) != 0: - raise BusinessTemplateMissingDependency, 'Impossible to install, please install the following dependencies before: %s'%repr(missing_dep_list) + raise BusinessTemplateMissingDependency, \ + 'Impossible to install %s, please install the following dependencies before: %s' \ + %(self.getTitle(), repr(missing_dep_list)) def getMissingDependencyList(self): """ diff --git a/product/ERP5/tests/testTaskReporting.py b/product/ERP5/tests/testTaskReporting.py index 892f5c4e4acc07ff199a36e9083d6a5fead300ac..d8abf7c24b3bc9136cccb562b538d9c0f5b7291b 100644 --- a/product/ERP5/tests/testTaskReporting.py +++ b/product/ERP5/tests/testTaskReporting.py @@ -44,15 +44,21 @@ class TestTaskReportingMixin(ERP5ReportTestCase): 'erp5_project', 'erp5_simulation_test') @reindex - def _makeOneTask(self, simulation_state='planned', **kw): + def _makeOneTask(self, simulation_state='planned', + line_aggregate_relative_url=None, **kw): """Create a task, support many options""" task = self.portal.task_module.newContent(portal_type='Task', specialise=self.business_process) task._edit(**kw) + if line_aggregate_relative_url: + task_line, = task.objectValues(portal_type="Task Line") + task_line.setAggregate(line_aggregate_relative_url) + if simulation_state == 'planned': task.plan() if simulation_state == 'confirmed': task.confirm() + return task def afterSetUp(self): """Setup the fixture. diff --git a/product/ERP5Type/tests/ERP5TypeTestCase.py b/product/ERP5Type/tests/ERP5TypeTestCase.py index 96cf49c7aa52877808b673748943c1347bf82c52..58d1e61e162a4c064da79ef4143aea466cae20d1 100644 --- a/product/ERP5Type/tests/ERP5TypeTestCase.py +++ b/product/ERP5Type/tests/ERP5TypeTestCase.py @@ -731,6 +731,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase): return sorted([ str(message.getMessage()) for message in obj.checkConsistency() ]) + def _callSetUpOnce(self): + setup_once = getattr(self, 'setUpOnce', None) + if setup_once is not None and \ + not getattr(self.portal, 'set_up_once_called', 0): + self.portal.set_up_once_called = 1 + ZopeTestCase._print('Executing setUpOnce ... ') + start = time.time() + setup_once() + ZopeTestCase._print('done (%.3fs)\n' % (time.time() - start)) + class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): def getPortalName(self): @@ -1073,16 +1083,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): 'Assignor', 'Author', 'Auditor', 'Associate'], []) user = uf.getUserById('ERP5TypeTestCase').__of__(uf) - setup_once = getattr(self, 'setUpOnce', None) - if setup_once is not None and \ - not getattr(portal, 'set_up_once_called', 0): - portal.set_up_once_called = 1 - if not quiet: - ZopeTestCase._print('Executing setUpOnce ... ') - start = time.time() - setup_once() - if not quiet: - ZopeTestCase._print('done (%.3fs)\n' % (time.time() - start)) + self._callSetUpOnce() # Enable reindexing # Do hot reindexing # Does not work diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py index d73f9bdc01cc4289631f9fde1becd9dc5f5e7c25..6f4096beff2b0e8749deb861184f552474473ee5 100755 --- a/product/ERP5Type/tests/runUnitTest.py +++ b/product/ERP5Type/tests/runUnitTest.py @@ -10,6 +10,7 @@ import signal import shutil import errno import random +import transaction from glob import glob import backportUnittest @@ -303,10 +304,16 @@ class ERP5TypeTestLoader(unittest.TestLoader): from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase + class ComponentTestCase(ERP5TypeLiveTestCase): + + def setUp(self): + super(ComponentTestCase, self).setUp() + self._callSetUpOnce() + # Bootstrap has been done in loadTestsFromNames, so the test can now # be loaded like any Live Test on a real instance - if ERP5TypeLiveTestCase not in ERP5TypeTestCase.__bases__: - ERP5TypeTestCase.__bases__ = ERP5TypeLiveTestCase, + if ComponentTestCase not in ERP5TypeTestCase.__bases__: + ERP5TypeTestCase.__bases__ = ComponentTestCase, # TestLoader() does not perform any import so import the Module manually module = __import__('erp5.component.test', @@ -675,6 +682,14 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None): root_logger.handlers.append(loghandler.StreamHandler(sys.stderr)) _print('done (%.3fs)\n' % (time.time() - _start)) result = TestRunner(verbosity=verbosity).run(suite) + transaction.commit() + except: + import traceback + print "runUnitTestList Exception : %r" % (traceback.print_exc(),) + # finally does not expect opened transaction, even in the + # case of a Ctrl-C. + transaction.abort() + raise finally: ProcessingNodeTestCase.unregisterNode() Storage.close()