Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0050951Openbravo ERPY. DBSourceManagerpublic2022-11-18 13:062022-11-29 08:13
migueldejuana 
caristu 
normalmajoralways
closedfixed 
5
 
PR23Q1 
Core
No
0050951: onCreateDefault not working for non mandatory columns referencing same table
onCreateDefault works properly when we define a new mandatory column referencing another column of the same table, but it is not working if the new column is not mandatory. It would be nice to also support this case.

For example, this new column in AD_ORG is not working because it is not mandatory:

<column name="EM_OBDO_AD_ORG_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault><![CDATA[AD_LEGALENTITY_ORG_ID]]></onCreateDefault>
       </column>

We should update the documentation:
http://wiki.openbravo.com/wiki/How_to_define_an_on_Create_Default [^]
n/a
No tags attached.
related to defect 0049897PR22Q4 closed alostale Add missing support for referencing other columns in onCreateDefault during importsampledata 
Issue History
2022-11-18 13:06migueldejuanaNew Issue
2022-11-18 13:06migueldejuanaAssigned To => Triage Platform Base
2022-11-18 13:06migueldejuanaModules => Core
2022-11-18 13:06migueldejuanaTriggers an Emergency Pack => No
2022-11-18 13:07migueldejuanaDescription Updatedbug_revision_view_page.php?rev_id=25143#r25143
2022-11-18 13:41caristuRelationship addedrelated to 0049897
2022-11-18 13:41caristuAssigned ToTriage Platform Base => caristu
2022-11-25 09:36hgbotNote Added: 0144134
2022-11-25 10:09hgbotNote Added: 0144135
2022-11-29 08:09hgbotResolutionopen => fixed
2022-11-29 08:09hgbotStatusnew => closed
2022-11-29 08:09hgbotNote Added: 0144216
2022-11-29 08:09hgbotNote Added: 0144217
2022-11-29 08:13hgbotNote Added: 0144218
2022-11-29 08:13hgbotFixed in Version => PR23Q1
2022-11-29 08:13hgbotNote Added: 0144219

Notes
(0144134)
hgbot   
2022-11-25 09:36   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/40 [^]
(0144135)
hgbot   
2022-11-25 10:09   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/775 [^]
(0144216)
hgbot   
2022-11-29 08:09   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: 46d2ef154b5a2d92d7c22fe38e8e046f4ba09ce2
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 29-11-2022 07:09:50
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/46d2ef154b5a2d92d7c22fe38e8e046f4ba09ce2 [^]

fixes BUG-50951: non literal OCD doesn't work in non mandatory columns

  On create default of a non mandatory column that references to a
column of the same table was not working.

---
A src-test/model/createDefault/M6.xml
A src-test/model/createDefault/M7.xml
A src-test/model/createDefault/NM5.xml
A src-test/model/createDefault/NM6.xml
M src-test/src/org/openbravo/dbsm/test/model/data/OtherDefaults.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0144217)
hgbot   
2022-11-29 08:09   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/40 [^]
(0144218)
hgbot   
2022-11-29 08:13   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/775 [^]
(0144219)
hgbot   
2022-11-29 08:13   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 07b6f9579dcb74a38f3b75dfd60a60300a5e5326
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 29-11-2022 08:11:21
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/07b6f9579dcb74a38f3b75dfd60a60300a5e5326 [^]

fixes BUG-50951: non literal OCD doesn't work in non mandatory columns

  Non literal OCD referencing to a column of the same table was not
being applied in non mandatory columns

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