Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022463Openbravo ERP09. Financial managementpublic2012-12-05 13:292012-12-06 15:12
plujan 
eduardo_Argal 
immediatemajorhave not tried
closedfixed 
5
pi 
3.0MP18 
pramakrishnan
Core
No
0022463: Incremental build fails if client's name is longer than 50 chars
When doing an incremental build having some client with a name longer than 50 chars, following error is displayed:

 [java] 102371 ERROR - SQL error in query: INSERT INTO ad_tree( ad_tree_id, ad_client_id, ad_org_id, created, createdby, updated, updatedby, isactive, name, description, treetype, isallnodes) VALUES (?, ?, '0', now(), '0', now(), '0', 'Y', SUBSTR(?, 1, 60), ?, SUBSTR(?, 1, 60), 'Y')Exception:org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "ad_tree_name"
     [java] 102375 ERROR - Error executing moduleScript org.openbravo.modulescript.UpdateADClientInfo: @CODE=0@ERROR: duplicate key value violates unique constraint "ad_tree_name"
     [java] 102379 ERROR - Error executing moduleScript: org.openbravo.modulescript.UpdateADClientInfo
     [java] Execution of moduleScript org.openbravo.modulescript.UpdateADClientInfofailed.
     [java] at org.openbravo.modulescript.ModuleScriptHandler.execute(ModuleScriptHandler.java:68)
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:173)
     [java] at org.openbravo.ddlutils.task.BaseDatabaseTask.execute(BaseDatabaseTask.java:86)
     [java] at org.openbravo.ddlutils.task.AlterDatabaseJava.main(AlterDatabaseJava.java:38)
     [java] Exception in thread "main" Execution of moduleScript org.openbravo.modulescript.UpdateADClientInfofailed.
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:248)
     [java] at org.openbravo.ddlutils.task.BaseDatabaseTask.execute(BaseDatabaseTask.java:86)
     [java] at org.openbravo.ddlutils.task.AlterDatabaseJava.main(AlterDatabaseJava.java:38)
     [java] Caused by: Execution of moduleScript org.openbravo.modulescript.UpdateADClientInfofailed.
     [java] at org.openbravo.modulescript.ModuleScriptHandler.execute(ModuleScriptHandler.java:68)
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:173)
     [java] ... 2 more
1. Create a client with more than 50 chars
2. Launch an incremental build
The error is caused by a trim that is being made, having tree names like "User Dimension 1" and "User Dimension 2", the trim results in CustomerName+"User Dimen" in both cases, creating a duplicated name.

The best solution is to get rid of the trim and increase field length to a 255 chars long value.
No tags attached.
related to feature request 00224033.0MP18 closed vmromanos Add support for Resource Category tree 
Issue History
2012-12-05 13:29plujanNew Issue
2012-12-05 13:29plujanAssigned To => dmiguelez
2012-12-05 13:29plujanTriggers an Emergency Pack => No
2012-12-05 13:29plujanModules => Core
2012-12-05 13:29plujanRelationship addedrelated to 0022403
2012-12-05 13:40plujanAssigned Todmiguelez => eduardo_Argal
2012-12-05 13:40plujanPrioritynormal => immediate
2012-12-05 17:00eduardo_ArgalStatusnew => scheduled
2012-12-05 17:00eduardo_Argalfix_in_branch => pi
2012-12-05 17:01hgbotCheckin
2012-12-05 17:01hgbotNote Added: 0054728
2012-12-05 17:01hgbotStatusscheduled => resolved
2012-12-05 17:01hgbotResolutionopen => fixed
2012-12-05 17:01hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ecbf3f2603a82b143ebe0c027a0e04f21cf79f4f [^]
2012-12-06 09:33pramakrishnanReview Assigned To => pramakrishnan
2012-12-06 09:33pramakrishnanNote Added: 0054741
2012-12-06 09:33pramakrishnanStatusresolved => closed
2012-12-06 15:12hudsonbotCheckin
2012-12-06 15:12hudsonbotNote Added: 0054757

Notes
(0054728)
hgbot   
2012-12-05 17:01   
Repository: erp/devel/pi
Changeset: ecbf3f2603a82b143ebe0c027a0e04f21cf79f4f
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Wed Dec 05 17:00:28 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ecbf3f2603a82b143ebe0c027a0e04f21cf79f4f [^]

Fixes bug 22463

---
M src-db/database/model/tables/AD_TREE.xml
M src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateADClientInfoData.class
M src-util/modulescript/src/org/openbravo/modulescript/UpdateADClientInfo_data.xsql
---
(0054741)
pramakrishnan   
2012-12-06 09:33   
Testing + Code Review - OK.
(0054757)
hudsonbot   
2012-12-06 15:12   
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/d438f7014f16 [^]

Maturity status: Test