Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021922Openbravo ERPA. Platformpublic2012-10-11 18:512012-10-23 14:40
caristu 
shankarb 
urgentmajorhave not tried
closedfixed 
5
 
3.0MP17pi 
dbaz
Core
No
0021922: Synchronize Terminology does not work properly with MERGE modules
Synchronize Terminology does not work properly with MERGE modules

There is a MAX in this line of the PL AD_SYNCHRONIZE:

https://code.openbravo.com/erp/devel/pi/file/80586c65a422/src-db/database/model/functions/AD_SYNCHRONIZE.xml#l235 [^]

So if you have more than one dbprefix in your module and you are trying to update the name of a column for a module that are not the MAX the processes fail trying
to put a name like: EM_PREFIXOFTHEMAXMODULE_EM_YOURREAL_PREFIX_CoulumnNAme and this is not allowed by the trigger AD_COLUMN_TRG2 so the
process fails.
1) Create a merged module with 2 different dbprefixes

2) Create two columns one of each module

3) Create two external columns, one of each module

4) Execute Synchronize Terminology
Modify the query adding a restriction from:

AND P.AD_MODULE_DBPREFIX_ID = (SELECT MAX(AD_MODULE_DBPREFIX_ID)
FROM AD_MODULE_DBPREFIX P1
WHERE P1.AD_MODULE_ID = C.Ad_MODULE_ID))

to

AND P.AD_MODULE_DBPREFIX_ID = (SELECT MAX(AD_MODULE_DBPREFIX_ID)
FROM AD_MODULE_DBPREFIX P1
WHERE P1.AD_MODULE_ID = C.Ad_MODULE_ID
++ AND ((instr(upper(C.columnname), 'EM_'||upper(P1.name)||'_') = 1)
++ OR (MT.AD_MODULE_ID = C.AD_MODULE_ID))
))

Adding this restriction we ensure that in the 'EM case' the prefix is the right one OR in a 'normal column case' that the prefix belong to their module.
No tags attached.
Issue History
2012-10-11 18:51caristuNew Issue
2012-10-11 18:51caristuAssigned To => AugustoMauch
2012-10-11 18:51caristuModules => Core
2012-10-11 18:51caristuResolution time => 1352674800
2012-10-11 18:51caristuIssue Monitored: networkb
2012-10-16 15:57AugustoMauchAssigned ToAugustoMauch => shankarb
2012-10-17 14:55hgbotCheckin
2012-10-17 14:55hgbotNote Added: 0053423
2012-10-17 14:55hgbotStatusnew => resolved
2012-10-17 14:55hgbotResolutionopen => fixed
2012-10-17 14:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f1f0bcb3e992a8b407760018a1f3c6611250461f [^]
2012-10-17 14:55shankarbReview Assigned To => dbaz
2012-10-17 14:55shankarbStatusresolved => new
2012-10-17 14:55shankarbResolutionfixed => open
2012-10-17 14:55shankarbFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/f1f0bcb3e992a8b407760018a1f3c6611250461f [^] =>
2012-10-17 14:56shankarbIssue Monitored: dbaz
2012-10-17 14:56shankarbStatusnew => scheduled
2012-10-17 14:56shankarbfix_in_branch => pi
2012-10-17 14:57shankarbStatusscheduled => resolved
2012-10-17 14:57shankarbFixed in Version => pi
2012-10-17 14:57shankarbFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f1f0bcb3e992a8b407760018a1f3c6611250461f [^]
2012-10-17 14:57shankarbResolutionopen => fixed
2012-10-22 13:27hudsonbotCheckin
2012-10-22 13:27hudsonbotNote Added: 0053513
2012-10-23 14:40dbazNote Added: 0053578
2012-10-23 14:40dbazStatusresolved => closed

Notes
(0053423)
hgbot   
2012-10-17 14:55   
Repository: erp/devel/pi
Changeset: f1f0bcb3e992a8b407760018a1f3c6611250461f
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Wed Oct 17 14:53:38 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f1f0bcb3e992a8b407760018a1f3c6611250461f [^]

Fixes Issue 0021922: Synchronize Terminology does not work properly with MERGE modules

Modifed case where the merge module was referred and it was not the MAX record in DB prefix table, Synchronize terminology fails.

---
M src-db/database/model/functions/AD_SYNCHRONIZE.xml
---
(0053513)
hudsonbot   
2012-10-22 13:27   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/483f2e6dc1af [^]

Maturity status: Test
(0053578)
dbaz   
2012-10-23 14:40   
Reviewed @ changeset: 18268 - 5e3903a17a28