Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024771Openbravo ERPA. Platformpublic2013-09-14 09:322013-09-17 19:03
shuehner 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0MP28 
shankarb
Core
No
0024771: Broken/useless onCreateDefault statement
There are quite a few identical onCreateDefault statements which are (now) broken and no longer useful.

As those always fail and create errors in log on the execution they should be removed.

ERROR: more than one row returned by a subquery used as an expression
STATEMENT: SELECT (SELECT AD_MODULE_ID FROM AD_MODULE WHERE AD_MODULE_ID<>'0' AND TYPE='M') FROM AD_MESSAGE LIMIT 1

Concretely:
Those are onCreateDefault constraints which are adding the 'ad_module_id' values to AD-tables on upgrade of 2.40 (which did not have modules) to 2.50.

In that upgrade all custom rows (which would need a module id generated) were placed into a customization module so there was exactly one module <> '0' in that upgrade so this sql code the value.

However now in pi first ad_module_id is mandatory and always filled + also there are always more module so that subselect can only fail with as it does not produce only a single value.

As upgrades from 2.40 to pi need to go always via 2.50 it should be fine to remove those onCreateDefaults in pi (and pi only) as there we are garanteed to always have those ad_module_id's filled and also if not those onCreateDefault would never work.
Check postgresql.log on any update.database for errors related to t
Remove the onCreateDefault values on pi as they cannot work.
No tags attached.
diff 24771.diff (22,718) 2013-09-14 10:27
https://issues.openbravo.com/file_download.php?file_id=6407&type=bug
Issue History
2013-09-14 09:32shuehnerNew Issue
2013-09-14 09:32shuehnerAssigned To => AugustoMauch
2013-09-14 09:32shuehnerModules => Core
2013-09-14 09:32shuehnerTriggers an Emergency Pack => No
2013-09-14 10:27shuehnerFile Added: 24771.diff
2013-09-16 10:28AugustoMauchIssue Monitored: shankarb
2013-09-16 10:28AugustoMauchReview Assigned To => shankarb
2013-09-16 15:18hgbotCheckin
2013-09-16 15:18hgbotNote Added: 0061173
2013-09-16 15:18hgbotStatusnew => resolved
2013-09-16 15:18hgbotResolutionopen => fixed
2013-09-16 15:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/39da19e84a241426a1de3fe6e1f1be67ee2aca3b [^]
2013-09-17 09:08shankarbNote Added: 0061188
2013-09-17 09:08shankarbStatusresolved => closed
2013-09-17 09:08shankarbFixed in Version => 3.0MP28
2013-09-17 19:03hudsonbotCheckin
2013-09-17 19:03hudsonbotNote Added: 0061256

Notes
(0061173)
hgbot   
2013-09-16 15:18   
Repository: erp/devel/pi
Changeset: 39da19e84a241426a1de3fe6e1f1be67ee2aca3b
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Sep 16 10:28:03 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/39da19e84a241426a1de3fe6e1f1be67ee2aca3b [^]

Fixes issue 24771: Removed broken onCreateDefault statements

The removed onCreateDefault statements only had sense when used to upgrade Openbravo from 2.40 to 2.50. They are not needed because in order to upgrade form 2.40 to pi, the user needs to previously upgrade to 2.50.

---
M modules/org.openbravo.client.kernel/src-db/database/model/tables/OBCLKER_TEMPLATE.xml
M modules/org.openbravo.service.datasource/src-db/database/model/tables/OBSERDS_DATASOURCE.xml
M modules/org.openbravo.userinterface.selector/src-db/database/model/tables/OBUISEL_SELECTOR_FIELD.xml
M src-db/database/model/tables/AD_AUXILIARINPUT.xml
M src-db/database/model/tables/AD_CALLOUT.xml
M src-db/database/model/tables/AD_CLIENTMODULE.xml
M src-db/database/model/tables/AD_COLUMN.xml
M src-db/database/model/tables/AD_DATASET.xml
M src-db/database/model/tables/AD_DATASET_COLUMN.xml
M src-db/database/model/tables/AD_DATASET_TABLE.xml
M src-db/database/model/tables/AD_ELEMENT.xml
M src-db/database/model/tables/AD_FIELD.xml
M src-db/database/model/tables/AD_FIELDGROUP.xml
M src-db/database/model/tables/AD_FORM.xml
M src-db/database/model/tables/AD_MENU.xml
M src-db/database/model/tables/AD_MESSAGE.xml
M src-db/database/model/tables/AD_MODULE_DBPREFIX.xml
M src-db/database/model/tables/AD_MODULE_DEPENDENCY.xml
M src-db/database/model/tables/AD_MODULE_LOG.xml
M src-db/database/model/tables/AD_MODULE_TRL.xml
M src-db/database/model/tables/AD_ORGMODULE.xml
M src-db/database/model/tables/AD_PACKAGE.xml
M src-db/database/model/tables/AD_PROCESS.xml
M src-db/database/model/tables/AD_REFERENCE.xml
M src-db/database/model/tables/AD_REF_DATA_LOADED.xml
M src-db/database/model/tables/AD_REF_LIST.xml
M src-db/database/model/tables/AD_TAB.xml
M src-db/database/model/tables/AD_TABLE.xml
M src-db/database/model/tables/AD_TEXTINTERFACES.xml
M src-db/database/model/tables/AD_VAL_RULE.xml
M src-db/database/model/tables/AD_WINDOW.xml
---
(0061188)
shankarb   
2013-09-17 09:08   
Code reviewed and verified in pi changeset a549285cc9f0
(0061256)
hudsonbot   
2013-09-17 19:03   
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/1c53d622fc50 [^]

Maturity status: Test