details: https://code.openbravo.com/erp/devel/pi/rev/c1578c1ceb8f changeset: 31383:c1578c1ceb8f user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Jan 25 10:31:47 2017 +0100 summary: [xlsx] Reporting engine now can export xlsx reports
details: https://code.openbravo.com/erp/devel/pi/rev/9bcfb8761cdc changeset: 31384:9bcfb8761cdc user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Jan 25 10:33:06 2017 +0100 summary: [xlsx] Created new property to configure excel export format details: https://code.openbravo.com/erp/devel/pi/rev/3a77fc50f2ae changeset: 31385:3a77fc50f2ae user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Jan 25 10:37:27 2017 +0100 summary: [xlsx] Small refactor to improve ExportType enum code details: https://code.openbravo.com/erp/devel/pi/rev/743dd7a896b5 changeset: 31386:743dd7a896b5 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Jan 25 10:54:45 2017 +0100 summary: [xlsx] Added new method to compare the EnumType extension details: https://code.openbravo.com/erp/devel/pi/rev/012bed2b31c7 changeset: 31387:012bed2b31c7 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Jan 25 11:05:21 2017 +0100 summary: [xlsx] make getExportType method of EnumType case-insensitive details: https://code.openbravo.com/erp/devel/pi/rev/7ca7bad64868 changeset: 31388:7ca7bad64868 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Jan 25 19:25:27 2017 +0100 summary: [xlsx] Take excel format based on the preference details: https://code.openbravo.com/erp/devel/pi/rev/1466f2f51595 changeset: 31389:1466f2f51595 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Jan 26 10:14:48 2017 +0100 summary: [xlsx] Use content type for xlsx extension when downloading xlsx reports details: https://code.openbravo.com/erp/devel/pi/rev/9eb231dbbc1e changeset: 31390:9eb231dbbc1e user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Jan 26 10:49:10 2017 +0100 summary: [xlsx] Minor changes to improve code readability details: https://code.openbravo.com/erp/devel/pi/rev/4bcd011c0cd1 changeset: 31391:4bcd011c0cd1 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Jan 26 16:28:35 2017 +0100 summary: [xlsx] Updated text to show Excel instead of XLS details: https://code.openbravo.com/erp/devel/pi/rev/39674b17b931 changeset: 31392:39674b17b931 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Jan 31 16:26:04 2017 +0100 summary: [xlsx] Allow to configure the maximum number of rows in an Excel report details: https://code.openbravo.com/erp/devel/pi/rev/6d940457cb8e changeset: 31393:6d940457cb8e user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Jan 31 16:27:42 2017 +0100 summary: [xlsx] Improved javadoc details: https://code.openbravo.com/erp/devel/pi/rev/416b4751afec changeset: 31394:416b4751afec user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Feb 01 11:20:03 2017 +0100 summary: [xlsx] Reverted maximum excel rows limit feature details: https://code.openbravo.com/erp/devel/pi/rev/982900c7923e changeset: 31395:982900c7923e user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Feb 01 11:37:23 2017 +0100 summary: [xlsx] Improved method that retrieves the 'ExcelExportFormat' preference details: https://code.openbravo.com/erp/devel/pi/rev/935e6cbab403 changeset: 31396:935e6cbab403 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Feb 01 12:12:05 2017 +0100 summary: [xlsx] Added missing check for valid excel formats details: https://code.openbravo.com/erp/devel/pi/rev/09a97a5d4248 changeset: 31397:09a97a5d4248 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Feb 01 12:27:07 2017 +0100 summary: [xlsx] Restore AD_ELEMENT column name to avoid an API change details: https://code.openbravo.com/erp/devel/pi/rev/859bd5a23d7d changeset: 31398:859bd5a23d7d user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Feb 01 19:33:49 2017 +0100 summary: [xlsx] Avoid unneeded nesting details: https://code.openbravo.com/erp/devel/pi/rev/e1966acdacf1 changeset: 31399:e1966acdacf1 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Feb 01 19:45:46 2017 +0100 summary: [xlsx] Use ExportType enum to retrieve content types details: https://code.openbravo.com/erp/devel/pi/rev/c67a4425a61b changeset: 31400:c67a4425a61b user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Feb 02 16:37:11 2017 +0100 summary: [xlsx] Update field name to show Use PDF as Excel Template details: https://code.openbravo.com/erp/devel/pi/rev/00086d9062b4 changeset: 31401:00086d9062b4 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Fri Feb 03 10:12:21 2017 +0100 summary: fixes issue 29862: Ability to generate excel reports with more than 65532 rows diffstat: .hgsigs | 2 + .hgtags | 2 + modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java | 6 +- modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java | 40 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml | 2 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_DATASET_TABLE.xml | 2 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_ELEMENT.xml | 10 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml | 6 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml | 2 +- modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/DatasourceEventObserver.java | 90 +- modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/ObserverBaseTest.java | 77 ++ modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/OrderLineTestObserver.java | 83 ++- modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/OrderTestObserver.java | 86 ++ modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/PersistanceObserver.java | 152 ++++ modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler_data.xsql | 4 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/StorePropertyActionHandler.java | 4 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/process/BaseProcessActionHandler.java | 8 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/process/ResponseActionsBuilder.java | 312 ++++++++++ modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java | 16 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java | 169 ++++- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js | 20 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js | 11 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js | 25 +- modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java | 14 +- modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java | 20 +- src-core/src/org/openbravo/data/Sql.java | 3 +- src-core/src/org/openbravo/data/Sqlc.java | 25 +- src-core/src/org/openbravo/database/ConnectionProviderImpl.java | 10 +- src-core/src/org/openbravo/database/JNDIConnectionProvider.java | 4 +- src-core/src/org/openbravo/database/RDBMSIndependent.java | 9 +- src-core/src/org/openbravo/database/SessionInfo.java | 71 +- src-db/database/model/functions/M_UPDATE_INVENTORY.xml | 3 +- src-db/database/sourcedata/AD_FIELD.xml | 2 +- src-db/database/sourcedata/AD_REF_LIST.xml | 12 + src-db/database/sourcedata/AD_TEXTINTERFACES.xml | 132 ++-- src-test/src/org/openbravo/test/AllAntTaskTests.java | 6 +- src-test/src/org/openbravo/test/base/OBBaseTest.java | 2 +- src-test/src/org/openbravo/test/costing/TestCosting.java | 2 +- src-test/src/org/openbravo/test/dal/DalPerformanceCriteriaTest.java | 25 +- src-test/src/org/openbravo/test/model/IndexesTest.java | 6 +- src-test/src/org/openbravo/test/webservice/JSONWebServicesWhereParameter.java | 10 +- src-test/src/org/openbravo/test/xml/UniqueConstraintImportTest.java | 15 +- src/org/openbravo/base/secureApp/HttpSecureAppServlet.java | 28 +- src/org/openbravo/costing/CostAdjustmentUtils.java | 6 +- src/org/openbravo/dal/core/DalRequestFilter.java | 26 +- src/org/openbravo/dal/core/DalSessionFactory.java | 41 +- src/org/openbravo/dal/core/OBContext.java | 65 +- src/org/openbravo/dal/core/OBInterceptor.java | 11 +- src/org/openbravo/dal/core/SessionHandler.java | 40 +- src/org/openbravo/dal/security/SecurityChecker.java | 9 +- src/org/openbravo/dal/service/OBDal.java | 14 + src/org/openbravo/erpCommon/ad_forms/DocLineCostAdjustment_data.xsql | 4 +- src/org/openbravo/erpCommon/ad_process/JasperProcess.java | 4 +- src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html | 2 +- src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html | 2 +- src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html | 8 +- src/org/openbravo/erpCommon/ad_reports/ReportWarehousePartnerJR.html | 4 +- src/org/openbravo/erpCommon/info/AttributeSetInstance.java | 4 +- src/org/openbravo/erpCommon/security/SessionLogin.java | 4 +- src/org/openbravo/erpCommon/security/SessionLogin_data.xsql | 4 +- src/org/openbravo/erpCommon/utility/DownloadReport.java | 18 +- src/org/openbravo/scheduling/DefaultJob.java | 3 +- src/org/openbravo/scheduling/ProcessRequest_data.xsql | 14 +- src/org/openbravo/scheduling/ProcessRun_data.xsql | 8 +- src/org/openbravo/service/db/DalConnectionProvider.java | 4 +- src/org/openbravo/service/importprocess/ImportEntryProcessor.java | 3 +- 66 files changed, 1417 insertions(+), 409 deletions(-) diffs (truncated from 3618 to 300 lines): diff -r 1f57a0054d99 -r 00086d9062b4 .hgsigs --- a/.hgsigs Mon Jan 23 13:30:16 2017 +0100 +++ b/.hgsigs Fri Feb 03 10:12:21 2017 +0100 @@ -204,5 +204,7 @@ b79e30a5b3532f45101cedce0f3bb6b0a86b5780 0 iEYEABECAAYFAlfz21YACgkQCX/oGf+2qkMqZgCgodjBPp4aS6GrpBTpumtr8DsFNAYAmwS3mdHHNYX8g8y4yIwjMDzmQG+o 892fdbc643c7c5c52298aae76502ab2283a32433 0 iEYEABECAAYFAlg0JDIACgkQCX/oGf+2qkM+5gCeMkJ6j6tr/FN8cPHlBLGdnf/6F08AoNBmFRFQ/osVwBtifI+b3ZzXEx+X e03ab293da7be8c989b20cb7b1ecf4bbf3c7c990 0 iEYEABECAAYFAlh959EACgkQCX/oGf+2qkOFNwCgi/qs8UguivvKA1tlKRKQoIsQqDIAoOGm7DqYBaR6v3aZtvaLmdvffaUh +81d470b918d385d47e958fe4c2d679cde07c9989 0 iEYEABECAAYFAliHS1kACgkQCX/oGf+2qkN/qgCeOAsukTY2FG0bVzdhXHw/K58kqlEAnAjixxvtQPM4PVmDYqzQDkGdqqtT 555379f85b18b37ee1c36b4137c75eca80da7267 0 iEYEABECAAYFAlhSQ0UACgkQCX/oGf+2qkN2yQCg5zq8YEVnWK3wy859qvLYbrEhBY4AoKsfpep+GEj+oGGlmOiOqESGPxxH fa51600e25b24b2eb3739898d293168ea94748a7 0 iEYEABECAAYFAlh/u8wACgkQCX/oGf+2qkPTnwCfZ29b107GdizLBcC+tzdP3HlnmUUAoN2kMLXvfTYSRLAQG/ziGm5P6kYA +9753e90ea3e81f850f904feb531120b4e185394a 0 iEYEABECAAYFAliG6A8ACgkQCX/oGf+2qkPeeQCg6D9p++eslvzqEVlYK8RS0uzgZNsAoMELVWkte/AM/ilPxZ4vP37myscv diff -r 1f57a0054d99 -r 00086d9062b4 .hgtags --- a/.hgtags Mon Jan 23 13:30:16 2017 +0100 +++ b/.hgtags Fri Feb 03 10:12:21 2017 +0100 @@ -215,5 +215,7 @@ f252db9dde915c15574e3d5fa505bd1154e39c74 3.0PR16Q3.2 0c8c781e34c94d084b495d00a541d8d57a3903ea 3.0PR16Q3.3 ed52b01e833ecc6407392f97ffd7d6531bd9bf2f 3.0PR16Q3.4 +ad0be95cec9715cc07fd82615c0de55f7c4a95b4 3.0PR16Q3.5 cd98953b932b72cc3c694904fc8f8549463ba84a 3.0PR16Q4 b93f495b2cde680cf6558d93d72051429f4b9031 3.0PR16Q4.1 +31c79a32ce3a6b555dadb35c70d63113be6312e7 3.0PR16Q4.2 diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java --- a/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java Fri Feb 03 10:12:21 2017 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2010-2016 Openbravo SLU + * All portions are Copyright (C) 2010-2017 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -104,13 +104,15 @@ * within same class, let's initialize it once per class but we cannot use @BeforeClass at this * point because we require of beanManager to be injected. */ + @Override @Before - public void setManager() { + public void setUp() throws Exception { if (!initialized) { WeldUtils.setStaticInstanceBeanManager(beanManager); kernelInitializer.setInterceptor(); initialized = true; } + super.setUp(); } /** diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java --- a/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java Fri Feb 03 10:12:21 2017 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2015 Openbravo SLU + * All portions are Copyright (C) 2015-2017 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -19,12 +19,17 @@ package org.openbravo.base.weld.test.testinfrastructure; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +import org.jboss.arquillian.junit.InSequence; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.openbravo.base.exception.OBException; import org.openbravo.base.provider.OBProvider; -import org.openbravo.base.weld.test.WeldBaseTest; +import org.openbravo.client.application.test.event.ObserverBaseTest; +import org.openbravo.client.application.test.event.OrderLineTestObserver; import org.openbravo.dal.service.OBDal; import org.openbravo.erpCommon.utility.OBMessageUtils; import org.openbravo.model.common.geography.Country; @@ -36,12 +41,39 @@ * @author alostale * */ -public class DalPersistanceEventTest extends WeldBaseTest { +public class DalPersistanceEventTest extends ObserverBaseTest { @Rule public ExpectedException exception = ExpectedException.none(); @Test - public void persisntaceObserversShouldBeExecuted() { + @InSequence(1) + public void beginTrxObserversShouldBeExecutedOnFirstTest() { + assertThat("begin transaction observer executions", + OrderLineTestObserver.getNumberOfStartedTrxs(), is(1)); + } + + @Test + @InSequence(2) + public void beginTrxObserversShouldBeExecutedOnSubsequentTests() { + assertThat("begin transaction observer executions", + OrderLineTestObserver.getNumberOfStartedTrxs(), is(1)); + } + + @Test + @InSequence(3) + public void endTrxObserversShouldBeExecuted() { + int initiallyClosedTrxs = OrderLineTestObserver.getNumberOfClosedTrxs(); + + OBDal.getInstance().commitAndClose(); + + assertThat("initial end transaction observer executions", initiallyClosedTrxs, is(0)); + assertThat("end transaction observer executions", + OrderLineTestObserver.getNumberOfClosedTrxs(), is(1)); + } + + @Test + @InSequence(4) + public void persistanceObserversShouldBeExecuted() { try { setSystemAdministratorContext(); Country newCountry = OBProvider.getInstance().get(Country.class); diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml Fri Feb 03 10:12:21 2017 +0100 @@ -774,7 +774,7 @@ <!--08AF323AC6C066ADE050007F0100548B--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--08AF323AC6C066ADE050007F0100548B--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--08AF323AC6C066ADE050007F0100548B--> <NAME><![CDATA[Use PDF as XLS Template]]></NAME> -<!--08AF323AC6C066ADE050007F0100548B--> <HELP><![CDATA[Determines whether the PDF Template needs to be used to generate the XLS instead of defining a specific template for it.]]></HELP> +<!--08AF323AC6C066ADE050007F0100548B--> <HELP><![CDATA[Determines whether the PDF Template needs to be used to generate the Excel report instead of defining a specific template for it.]]></HELP> <!--08AF323AC6C066ADE050007F0100548B--> <COLUMNNAME><![CDATA[USE_Pdf_As_Xls_Template]]></COLUMNNAME> <!--08AF323AC6C066ADE050007F0100548B--> <AD_TABLE_ID><![CDATA[C7CAB786F3EF4DF0B5E7B9AC6EC7DED8]]></AD_TABLE_ID> <!--08AF323AC6C066ADE050007F0100548B--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID> diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_DATASET_TABLE.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_DATASET_TABLE.xml Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_DATASET_TABLE.xml Fri Feb 03 10:12:21 2017 +0100 @@ -65,7 +65,7 @@ <!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <AD_TABLE_ID><![CDATA[C7CAB786F3EF4DF0B5E7B9AC6EC7DED8]]></AD_TABLE_ID> <!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <INCLUDEALLCOLUMNS><![CDATA[Y]]></INCLUDEALLCOLUMNS> <!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <WHERECLAUSE><![CDATA[obuiapp_process_id in (select obuiapp_process_id from obuiapp_process where ad_module_id in (:moduleid))]]></WHERECLAUSE> -<!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <EXCLUDEAUDITINFO><![CDATA[N]]></EXCLUDEAUDITINFO> +<!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <EXCLUDEAUDITINFO><![CDATA[Y]]></EXCLUDEAUDITINFO> <!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <ISBUSINESSOBJECT><![CDATA[N]]></ISBUSINESSOBJECT> <!--7AA152F1C7D340CD9C29F2D4926EBFE0--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--7AA152F1C7D340CD9C29F2D4926EBFE0--></AD_DATASET_TABLE> diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_ELEMENT.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_ELEMENT.xml Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_ELEMENT.xml Fri Feb 03 10:12:21 2017 +0100 @@ -46,8 +46,8 @@ <!--08AF323AC6C766ADE050007F0100548B--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--08AF323AC6C766ADE050007F0100548B--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--08AF323AC6C766ADE050007F0100548B--> <COLUMNNAME><![CDATA[XLS_Template]]></COLUMNNAME> -<!--08AF323AC6C766ADE050007F0100548B--> <NAME><![CDATA[XLS Template]]></NAME> -<!--08AF323AC6C766ADE050007F0100548B--> <PRINTNAME><![CDATA[XLS Template]]></PRINTNAME> +<!--08AF323AC6C766ADE050007F0100548B--> <NAME><![CDATA[Excel Template]]></NAME> +<!--08AF323AC6C766ADE050007F0100548B--> <PRINTNAME><![CDATA[Excel Template]]></PRINTNAME> <!--08AF323AC6C766ADE050007F0100548B--> <HELP><![CDATA[JRXML template to export to Excel the report when a specific template is required for excel]]></HELP> <!--08AF323AC6C766ADE050007F0100548B--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--08AF323AC6C766ADE050007F0100548B--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY> @@ -59,9 +59,9 @@ <!--08AF323AC6C866ADE050007F0100548B--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--08AF323AC6C866ADE050007F0100548B--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--08AF323AC6C866ADE050007F0100548B--> <COLUMNNAME><![CDATA[USE_Pdf_As_Xls_Template]]></COLUMNNAME> -<!--08AF323AC6C866ADE050007F0100548B--> <NAME><![CDATA[Use PDF as XLS Template]]></NAME> -<!--08AF323AC6C866ADE050007F0100548B--> <PRINTNAME><![CDATA[Use PDF as XLS Template]]></PRINTNAME> -<!--08AF323AC6C866ADE050007F0100548B--> <HELP><![CDATA[Determines whether the PDF Template needs to be used to generate the XLS instead of defining a specific template for it.]]></HELP> +<!--08AF323AC6C866ADE050007F0100548B--> <NAME><![CDATA[Use PDF as Excel Template]]></NAME> +<!--08AF323AC6C866ADE050007F0100548B--> <PRINTNAME><![CDATA[Use PDF as Excel Template]]></PRINTNAME> +<!--08AF323AC6C866ADE050007F0100548B--> <HELP><![CDATA[Determines whether the PDF Template needs to be used to generate the Excel report instead of defining a specific template for it.]]></HELP> <!--08AF323AC6C866ADE050007F0100548B--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--08AF323AC6C866ADE050007F0100548B--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY> <!--08AF323AC6C866ADE050007F0100548B--></AD_ELEMENT> diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml Fri Feb 03 10:12:21 2017 +0100 @@ -605,7 +605,7 @@ <!--08AEFECA5A607AECE050007F0100529C--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> <!--08AEFECA5A607AECE050007F0100529C--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--08AEFECA5A607AECE050007F0100529C--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> -<!--08AEFECA5A607AECE050007F0100529C--> <NAME><![CDATA[XLS Template]]></NAME> +<!--08AEFECA5A607AECE050007F0100529C--> <NAME><![CDATA[Excel Template]]></NAME> <!--08AEFECA5A607AECE050007F0100529C--> <HELP><![CDATA[JRXML template to export to Excel the report when a specific template is required for excel]]></HELP> <!--08AEFECA5A607AECE050007F0100529C--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> <!--08AEFECA5A607AECE050007F0100529C--> <AD_TAB_ID><![CDATA[2B7B3CCDC940436F93437445AA7752F3]]></AD_TAB_ID> @@ -633,8 +633,8 @@ <!--08AEFECA5A617AECE050007F0100529C--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> <!--08AEFECA5A617AECE050007F0100529C--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--08AEFECA5A617AECE050007F0100529C--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> -<!--08AEFECA5A617AECE050007F0100529C--> <NAME><![CDATA[Use PDF as XLS Template]]></NAME> -<!--08AEFECA5A617AECE050007F0100529C--> <HELP><![CDATA[Determines whether the PDF Template needs to be used to generate the XLS instead of defining a specific template for it.]]></HELP> +<!--08AEFECA5A617AECE050007F0100529C--> <NAME><![CDATA[Use PDF as Excel Template]]></NAME> +<!--08AEFECA5A617AECE050007F0100529C--> <HELP><![CDATA[Determines whether the PDF Template needs to be used to generate the Excel report instead of defining a specific template for it.]]></HELP> <!--08AEFECA5A617AECE050007F0100529C--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> <!--08AEFECA5A617AECE050007F0100529C--> <AD_TAB_ID><![CDATA[2B7B3CCDC940436F93437445AA7752F3]]></AD_TAB_ID> <!--08AEFECA5A617AECE050007F0100529C--> <AD_COLUMN_ID><![CDATA[08AF323AC6C066ADE050007F0100548B]]></AD_COLUMN_ID> diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml Fri Feb 03 10:12:21 2017 +0100 @@ -1755,7 +1755,7 @@ <!--CDBC4895920A424CB8715EC232729ABD--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--CDBC4895920A424CB8715EC232729ABD--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--CDBC4895920A424CB8715EC232729ABD--> <VALUE><![CDATA[OBUIAPP_XLSExport]]></VALUE> -<!--CDBC4895920A424CB8715EC232729ABD--> <MSGTEXT><![CDATA[Export to XLS]]></MSGTEXT> +<!--CDBC4895920A424CB8715EC232729ABD--> <MSGTEXT><![CDATA[Export to Excel]]></MSGTEXT> <!--CDBC4895920A424CB8715EC232729ABD--> <MSGTYPE><![CDATA[I]]></MSGTYPE> <!--CDBC4895920A424CB8715EC232729ABD--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--CDBC4895920A424CB8715EC232729ABD--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N> diff -r 1f57a0054d99 -r 00086d9062b4 modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/DatasourceEventObserver.java --- a/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/DatasourceEventObserver.java Mon Jan 23 13:30:16 2017 +0100 +++ b/modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/DatasourceEventObserver.java Fri Feb 03 10:12:21 2017 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2016 Openbravo SLU + * All portions are Copyright (C) 2016-2017 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -19,6 +19,7 @@ package org.openbravo.client.application.test.event; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; @@ -29,15 +30,9 @@ import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import org.hibernate.criterion.Restrictions; -import org.junit.AfterClass; import org.junit.Test; import org.openbravo.base.structure.BaseOBObject; -import org.openbravo.base.weld.test.WeldBaseTest; -import org.openbravo.client.application.Note; -import org.openbravo.dal.core.OBContext; -import org.openbravo.dal.service.OBCriteria; import org.openbravo.dal.service.OBDal; -import org.openbravo.model.ad.datamodel.Table; import org.openbravo.model.common.order.Order; import org.openbravo.model.common.order.OrderLine; import org.openbravo.service.datasource.DataSourceService; @@ -52,17 +47,11 @@ * @author alostale * */ -public class DatasourceEventObserver extends WeldBaseTest { +public class DatasourceEventObserver extends ObserverBaseTest { @Inject private DataSourceServiceProvider dataSourceServiceProvider; - enum ObserverExecutionType { - OFF, UPDATE_DESCRIPTION, CREATE_NOTE, COUNT_LINES, UPDATE_PARENT - }; - - static ObserverExecutionType observerExecutionType = ObserverExecutionType.OFF; - /** Updating order line without observer */ @Test public void standardUpdateRequestWithoutObserver() throws JSONException { @@ -137,19 +126,62 @@ is(OrderLineTestObserver.FORCED_DESCRIPTION)); } - private OrderLine pickARandomOrderLine() { - return (OrderLine) OBDal.getInstance().createCriteria(OrderLine.class).setMaxResults(1) - .uniqueResult(); + /** + * The OrderLine observer updates an order line's header. This action should fire the Order + * observer and just once. + */ + @Test + public void observerFiredByChildObjectObserverShouldBeExecuteOnce() throws JSONException { + observerExecutionType = ObserverExecutionType.UPDATE_PARENT_RANDOM; + + OrderLine ol = pickARandomOrderLine(); + + String randomDescription = Long.toString(System.currentTimeMillis()); + datasourceUpdate(ol, randomDescription); + + int[] executions = { OrderTestObserver.getNumberOfExecutions(), + OrderLineTestObserver.getNumberOfExecutions() }; + assertThat("Observers executions", new int[] { 1, 1 }, equalTo(executions)); + } + + /** + * The Order observer updates an order line. This action should fire the OrderLine observer and + * just once. + */ + @Test + public void observerFiredByParentObjectObserverShouldBeExecuteOnce() throws JSONException { + // Use ON_NOOP execution type to avoid subsequent actions from the OrderLine observer + observerExecutionType = ObserverExecutionType.ON_NOOP; + + Order order = pickARandomOrderLine().getSalesOrder(); ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits