Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015065Openbravo ERP00. Application dictionarypublic2010-10-28 12:532010-12-16 22:16
networkb 
alostale 
urgentmajoralways
closedfixed 
5
2.50MP22 
2.50MP25 
Core
No
0015065: A column with a reference (TABLE) that have a Display Column doesn't work
A column with a reference (TABLE) that have a Display Column with this characteristics doesn't work:
1.- Column Name not equal TableName_ID
2.- Reference: Search

This error appears in the log:


ERROR org.openbravo.erpCommon.utility.ComboTableData - Error of SQL in query: SELECT td0.C_Invoice_ID AS ID, , '' AS DESCRIPTION
FROM C_Invoice td0
left join EM_Mo_Sea td1 on td0.EM_Mo_Search = td1.EM_Mo_Search
AND td1.AD_Client_ID IN ('0','1000000')
AND td1.AD_Org_ID IN ('1000000','1000002','1000003','1000004','1000005','1000006','1000008','1000009','1000007','0')
WHERE td0.AD_Client_ID IN ('0','1000000')
AND td0.AD_Org_ID IN ('1000000','1000002','1000003','1000004','1000005','1000006','1000008','1000009','1000007','0')
AND (td0.isActive = 'Y' OR td0.C_Invoice_ID = (?) )


Reported by XME
Ticket: 9762

- As System Administrator go to Application Dictionary || Module
- Create a module:
      - DB Prefix: MO

- Create a new column in C_order
      - alter table c_order add EM_MO_column varchar(25)
      - alter table c_invoice add EM_MO_search varchar(25)

- As System Administrator go to Application Dictionary || Tables and Columns
- select c_invoice and go to the new column (EM_MO_search)
      - Reference: Search
      - Reference Search Key: Location

- As System administrator go to Application Dictionary || Reference || Reference
- Create a new reference:
      - Name: new reference
      - Parent Reference: table
- Go to Table reference:
      - Table: C_Invoice
      - key column: C_Invoice_Id
      - Display column: EM_MO_search

- As System Administrator go to Application Dictionary || Tables and Columns
- Select c_order and go to the new column.
      - reference: table
      - Reference Search Key: new reference

- Go to Application Dictionary || Windows, Tabs, and Fields
- Create a new field in Sales Order
      - Column: EM_MO_Column

- compile and restart tomcat
- As Openbravo Admin go to Sales Order
- realize that the window does not work
No tags attached.
? org.test-1.0.0.obx (6,586) 2010-11-22 10:20
https://issues.openbravo.com/file_download.php?file_id=3349&type=bug
Issue History
2010-10-28 12:53networkbNew Issue
2010-10-28 12:53networkbAssigned To => alostale
2010-10-28 13:16rafademiguelNote Added: 0032300
2010-10-28 13:18rafademiguelIssue Monitored: rafademiguel
2010-11-02 07:54alostaleTarget Version2.50MP24 => 2.50MP25
2010-11-02 07:56alostaleStatusnew => scheduled
2010-11-19 13:37alostaleFile Added: org.test-1.0.0.obx
2010-11-19 13:37alostaleNote Added: 0032738
2010-11-22 10:20alostaleFile Deleted: org.test-1.0.0.obx
2010-11-22 10:20alostaleFile Added: org.test-1.0.0.obx
2010-11-22 10:22hgbotCheckin
2010-11-22 10:22hgbotNote Added: 0032776
2010-11-22 10:22hgbotStatusscheduled => resolved
2010-11-22 10:22hgbotResolutionopen => fixed
2010-11-22 10:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d403914163758c9116a53a65cc3c7d9cbbf04990 [^]
2010-11-30 17:51hudsonbotCheckin
2010-11-30 17:51hudsonbotNote Added: 0032929
2010-12-14 11:03marvintmNote Added: 0033152
2010-12-14 11:03marvintmStatusresolved => closed
2010-12-16 22:16anonymoussf_bug_id0 => 3138790

Notes
(0032300)
rafademiguel   
2010-10-28 13:16   
I think the problem is....

When comboTableData are going to get the identifier value for the combo use the method "setTableDirQuery"

  private void identifier(String tableName, FieldProvider field) throws Exception {....

case 30: // Search
      setTableDirQuery(tableName, ((field == null) ? "" : field.getField("name")),
          ((field == null) ? "" : field.getField("name")));
......
......


this methods is suppose to be used only when the name of the column are TableName_ID because to get the identifier/s execute:

  private void setTableDirQuery(String tableName, String fieldName, String parentFieldName)
      throws Exception {
.......
tableDirName = name.substring(0, name.length() - 3);
.......
ComboTableQueryData trd[] = ComboTableQueryData.identifierColumns(getPool(), tableDirName);
......
......

because the name of the column is not TableName_ID this query returns nothing and the combo can't be constructed
(0032738)
alostale   
2010-11-19 13:37   
attached test obx file to reproduce the issue
(0032776)
hgbot   
2010-11-22 10:22   
Repository: erp/devel/pi
Changeset: d403914163758c9116a53a65cc3c7d9cbbf04990
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Nov 22 10:22:01 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d403914163758c9116a53a65cc3c7d9cbbf04990 [^]

fixed bug 15065: not possible to use column wihtou followin tableDir convention
            for a table reference

---
M src/org/openbravo/reference/ui/UITableDir.java
---
(0032929)
hudsonbot   
2010-11-30 17:51   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/d40391416375 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/7c27b4b566df [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.19017.obx [^]
(0033152)
marvintm   
2010-12-14 11:03   
The provided example works fine.