Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0018002Openbravo ERP00. Application dictionarypublic2011-07-15 14:262022-02-01 08:08
neil_smith 
Triage Platform Base 
highmajoralways
acknowledgedopen 
5
3.0MP0 
 
Core
No
0018002: Table with multiple references to product table - No key found in parent tab
I have a table in a module that has 2 references to the product table, M_Product_Abo_ID and M_Product_Cover_ID.
In version 3, when creating the tab, there is no way to specify which column is linked to parent column. I want to link M_Product_Cover_ID to M_Product.M_Product_ID in one tab. But I will also want another tab that links M_Product_Abo_ID to M_Product.M_Product_ID.
When I compile the window, I get an error
     [java] 632 [main] INFO org.openbravo.wad.Wad - Processing Window: Product - Tab: Product - id: 180
     [java] 2511 [main] INFO org.openbravo.wad.Wad - Processing Window: Product - Tab: Abonnement - id: 700AB46775064E43ACB4EB1AA4A7B7B1
     [java] 2703 [main] WARN org.openbravo.wad.Wad - No key found in parent tab: Product

My tab simply doesn't work, I thought it would display all the sons, without regard to the selected product. But no, it doesn't display anything!
I found out that it automaticaly linked the M_Product_Abo_ID column to the M_Product.M_Product_ID column when I put an HQL where clause, because I made a mistake and it displayed the where clause:
Error
Exception when creating query select e from dfabo_abo as e where ( (( e.productAbo.id = :alias_0 )) and (e.productCoverId = :alias_1 ) ) and e.organization.id in ('0', 'FF8081813119C14E01311D5A52090592') and e.client.id in ('FF8081813119C14E01311D42D59203AF', '0')order by e.documentNo

I corrected my HQL where clause (e.productCover.id), and of course, it still didn't work... So I tried to put the same product in the 2 fields and then it worked...

I really don't know what to do so that it works right...
Note that the ID of the M_Product_Abo_ID field is smaller than the m_Product_Cover_ID, that's probably why it takes it...
1) Create a new table with 2 references to the same table, but none using the same name as the key in the referenced table (M_Product_Abo_ID and M_Product_Cover_ID).
- The M_Product_Abo_ID is reference 'Search' and reference search key 'Product Complete'.
- The M_Product_Cover_ID is reference 'Table' and reference search key 'M_Product (no summary).

2) Add a tab to the product window and try to link the M_Product_Cover_ID field to the M_Product.M_Product_ID field...

If your solution works, try linking the M_Product_Abo_ID field to the M_Product.M_Product_ID. I suspect that it takes the column with the smallest ID to do the link.
Isn't it possible to select the column in the table that we want to link to the key in the parent column
No tags attached.
Issue History
2011-07-15 14:26neil_smithNew Issue
2011-07-15 14:26neil_smithAssigned To => alostale
2011-07-15 14:26neil_smithModules => Core
2011-09-19 23:35psarobeStatusnew => scheduled
2012-03-08 08:21alostaleTypedefect => design defect
2017-03-31 14:36alostaleStatusscheduled => acknowledged
2017-04-10 14:34alostaleAssigned Toalostale => platform
2022-02-01 08:08alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.