[view] fixed more test cases
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 06 Aug 2018 16:43:06 +0200
changeset 35071 813f68aaf192
parent 35070 084e4c366d84
child 35072 a244cd3d71a7
[view] fixed more test cases
src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java
--- a/src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java	Mon Aug 06 11:35:02 2018 +0200
+++ b/src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java	Mon Aug 06 16:43:06 2018 +0200
@@ -107,14 +107,16 @@
     GCTab gctab = null;
     OBContext.setAdminMode(false);
     try {
+      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
       gctab = OBProvider.getInstance().get(GCTab.class);
       gctab.setClient(OBDal.getInstance().get(Client.class, CLIENT_FOR_GC_SYSTEM_FIELD_TAB));
       gctab.setOrganization(OBDal.getInstance().get(Organization.class, ZERO_ORGANIZATION));
       gctab.setFilterable("N");
       gctab.setSeqno(SEQUENCE);
-      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
+      gctab.setTab(tab);
       tab.getOBUIAPPGCTabList().add(gctab);
       OBDal.getInstance().save(gctab);
+      OBDal.getInstance().flush();
 
       tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
       JSONObject tabConfig = OBViewUtil.getGridConfigurationSettings(tab, getSystemGridConfig(),
@@ -151,13 +153,16 @@
       OBDal.getInstance().save(gcsystem);
       OBDal.getInstance().flush();
 
+      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
       gctab.setClient(OBDal.getInstance().get(Client.class, CLIENT_FOR_GC_SYSTEM_FIELD_TAB));
       gctab.setOrganization(OBDal.getInstance().get(Organization.class, ZERO_ORGANIZATION));
       gctab.setFilterable("N");
       gctab.setSeqno(SEQUENCE);
-      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
+      gctab.setTab(tab);
+
       tab.getOBUIAPPGCTabList().add(gctab);
       OBDal.getInstance().save(gctab);
+      OBDal.getInstance().flush();
 
       tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
 
@@ -243,11 +248,12 @@
       OBDal.getInstance().save(gcsystem);
       OBDal.getInstance().flush();
 
+      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
       gctab = OBProvider.getInstance().get(GCTab.class);
       gctab.setClient(OBDal.getInstance().get(Client.class, CLIENT_FOR_GC_SYSTEM_FIELD_TAB));
       gctab.setOrganization(OBDal.getInstance().get(Organization.class, ZERO_ORGANIZATION));
       gctab.setSeqno(SEQUENCE);
-      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
+      gctab.setTab(tab);
       tab.getOBUIAPPGCTabList().add(gctab);
       OBDal.getInstance().save(gctab);
 
@@ -256,8 +262,10 @@
       gcfield.setOrganization(OBDal.getInstance().get(Organization.class, ZERO_ORGANIZATION));
       gcfield.setField(OBDal.getInstance().get(Field.class, BUSINESS_PARTNER_CATEGORY_FIELD_ID));
       gcfield.setSortable("N");
+      gcfield.setObuiappGcTab(gctab);
       gctab.getOBUIAPPGCFieldList().add(gcfield);
       OBDal.getInstance().save(gcfield);
+      OBDal.getInstance().flush();
 
       Field field = OBDal.getInstance().get(Field.class, BUSINESS_PARTNER_CATEGORY_FIELD_ID);
       JSONObject fieldConfig = OBViewUtil.getGridConfigurationSettings(field,
@@ -292,12 +300,13 @@
     GCField gcfield = null;
     OBContext.setAdminMode(false);
     try {
+      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
       gctab = OBProvider.getInstance().get(GCTab.class);
       gctab.setClient(OBDal.getInstance().get(Client.class, CLIENT_FOR_GC_SYSTEM_FIELD_TAB));
       gctab.setOrganization(OBDal.getInstance().get(Organization.class, ZERO_ORGANIZATION));
       gctab.setFilterable("N");
       gctab.setSeqno(SEQUENCE);
-      Tab tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
+      gctab.setTab(tab);
       tab.getOBUIAPPGCTabList().add(gctab);
       OBDal.getInstance().save(gctab);
 
@@ -306,8 +315,10 @@
       gcfield.setOrganization(OBDal.getInstance().get(Organization.class, ZERO_ORGANIZATION));
       gcfield.setField(OBDal.getInstance().get(Field.class, BUSINESS_PARTNER_CATEGORY_FIELD_ID));
       gcfield.setSortable("Y");
+      gcfield.setObuiappGcTab(gctab);
       gctab.getOBUIAPPGCFieldList().add(gcfield);
       OBDal.getInstance().save(gcfield);
+      OBDal.getInstance().flush();
 
       tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
       JSONObject tabConfig = OBViewUtil.getGridConfigurationSettings(tab, getSystemGridConfig(),