Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046245Openbravo ERPY. DBSourceManagerpublic2021-04-11 10:482021-06-04 11:47
AugustoMauch 
platform 
normalmajorhave not tried
closedfixed 
5
 
PR21Q3 
Core
No
0046245: Support including source data of optional dependencies in dual modules
Until now dual modules were allowed to contain frontend code for both org.openbravo.mobile.core and org.openbravo.core2 applications. Now it has been requested that these modules are able to contain also source data of org.openbravo.core2 application so that:
- Running update.database in an environment where org.openbravo.core2 is not installed is supported
- When running export.database afterwards does not delete the org.openbravo.core2 sourcedata that was missing from the database
-
No tags attached.
causes defect 0046974 closed AugustoMauch POS2 cannot export user action 
Issue History
2021-04-11 10:48AugustoMauchNew Issue
2021-04-11 10:48AugustoMauchAssigned To => platform
2021-04-11 10:48AugustoMauchModules => Core
2021-04-11 10:48AugustoMauchTriggers an Emergency Pack => No
2021-04-11 10:57hgbotNote Added: 0127206
2021-04-11 17:49AugustoMauchStatusnew => scheduled
2021-04-13 09:13hgbotResolutionopen => fixed
2021-04-13 09:13hgbotStatusscheduled => closed
2021-04-13 09:13hgbotNote Added: 0127242
2021-04-13 09:13hgbotNote Added: 0127243
2021-04-13 09:18hgbotNote Added: 0127245
2021-04-13 09:19hgbotNote Added: 0127246
2021-04-13 09:19hgbotFixed in Version => PR21Q3
2021-04-13 09:19hgbotNote Added: 0127247
2021-06-03 10:17alostaleRelationship addedcauses 0046974
2021-06-04 10:53hgbotNote Added: 0129060
2021-06-04 11:47hgbotNote Added: 0129065

Notes
(0127206)
hgbot   
2021-04-11 10:57   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/22 [^]
(0127242)
hgbot   
2021-04-13 09:13   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: 79e714ac70dc8e2de9b1d5e022ee6c181965f9a4
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 2021-04-12T12:15:29+02:00
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/79e714ac70dc8e2de9b1d5e022ee6c181965f9a4 [^]

Fixes ISSUE-46245: sourcedata and sampledata of uninstalled optional modules is not removed

Now dual modules can have sourcedata and sampledata of tables that belong to optional modules (i.e. org.openbravo.core2, OBC2 dbprefix).

When running update.database the sourcedata will just not be installed (no change needed for this), and then when running
export.database, the OBC2 source data will not be removed even though it was missing from the database.

When importing the sampledata, those of tables that belong to uninstalled optional modules will not be imported, and when running
export.sample.data afterwards, those files will not be deleted.

The change has been done so that it is easy to support more optional modules (i.e. org.openbravo.pos2).

---
M src/org/openbravo/ddlutils/task/ExportDatabase.java
M src/org/openbravo/ddlutils/task/ExportSampledata.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0127243)
hgbot   
2021-04-13 09:13   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/22 [^]
(0127245)
hgbot   
2021-04-13 09:18   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/346 [^]
(0127246)
hgbot   
2021-04-13 09:19   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/346 [^]
(0127247)
hgbot   
2021-04-13 09:19   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: ebf31272adf81910f2aca44189f82c56f50f11d2
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 2021-04-13T09:17:19+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/ebf31272adf81910f2aca44189f82c56f50f11d2 [^]

Fixes ISSUE-46245: sourcedata and sampledata of uninstalled optional modules is not removed

Now dual modules can have sourcedata and sampledata of tables that belong to optional modules (i.e. org.openbravo.core2, OBC2 dbprefix).

When running update.database the sourcedata will just not be installed (no change needed for this), and then when running
export.database, the OBC2 source data will not be removed even though it was missing from the database.

When importing the sampledata, those of tables that belong to uninstalled optional modules will not be imported, and when running
export.sample.data afterwards, those files will not be deleted.

The change has been done so that it is easy to support more optional modules (i.e. org.openbravo.pos2).

---
M src-db/database/lib/dbsourcemanager.jar
---
(0129060)
hgbot   
2021-06-04 10:53   
Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: a29a08bfe127cdd7d3d8db50ff3d9511cc98d369
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-06-04T08:52:28+00:00
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/a29a08bfe127cdd7d3d8db50ff3d9511cc98d369 [^]

fixes BUG-46974: cannot export data of tables from core2

Source data in core2 AD tables was not exported. ISSUE-46245 skips
export of these tables in case the module that defines them is not
installed.

When exporting source data it was not working because it incorrectly
dected core2 to be always not installed. It relied on
DBSMOBUtil.allModules to be correctly completelly initialized which is
not the case after calling getSortedTemplates.

Now the optional modules not installed are initialized in getModules and
kept after getSortedTemplates. belongsToOptionalUninstalledModule method
must be invoked after getModules, now if called before it will
explicitily fail.

---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0129065)
hgbot   
2021-06-04 11:47   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 870040145e6772c5c7a8a689055a6f6f2d53775a
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-06-04T10:55:51+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/870040145e6772c5c7a8a689055a6f6f2d53775a [^]

fixes BUG-46974: core2 tables export; fixes BUG-46647: sampledata defaults

dbsm including the fixes for:

BUG-46974: cannot export data of tables from core2

  Source data in core2 AD tables was not exported. ISSUE-46245 skips
  export of these tables in case the module that defines them is not
  installed.

  When exporting source data it was not working because it incorrectly
  dected core2 to be always not installed. It relied on
  DBSMOBUtil.allModules to be correctly completelly initialized which is
  not the case after calling getSortedTemplates.

  Now the optional modules not installed are initialized in getModules and
  kept after getSortedTemplates. belongsToOptionalUninstalledModule method
  must be invoked after getModules, now if called before it will
  explicitily fail.

BUG-46647: no default applied when inserting sample data

  When inserting sample data neither default or on create default were
  applied. This made more difficult to import sample data in an instance
  with a different set of modules than the ones used to generate it.

  Now when trying to import sample data with null values in mandatory columns
  the following is applied:

   * If there is an on create default literal value it gets applied. Note on
     create default based on subqueries cannot be applied.
   * If there is no create default, default value gets applied.

---
M src-db/database/lib/dbsourcemanager.jar
---