New table whose name ends in "Line" and does not have a Header table

Description

The steps to reproduce the error are:
1. Create a new Table: LUY_ProductLine
2. Add new column LUY_ProductLine_ID to table M_Product
3. Add new field for LUY_ProductLine_ID column in Products window
4. When opening the Products window the following error occurs:

20:20:45.460===========> GridFieldVO.loadLookupInfo: No LookupInfo for LUY_ProductLine_ID [42]
java.lang.NullPointerException
at org.compiere.util.DB.isSOTrx(DB.java:1752)
at org.compiere.util.Env.getZoomWindowID(Env.java:2035)
at org.compiere.model.MLookupFactory.getLookup_Table(MLookupFactory.java:607)
at org.compiere.model.MLookupFactory.getLookupInfo(MLookupFactory.java:201)
at org.compiere.model.GridFieldVO.loadLookupInfo(GridFieldVO.java:853)
at org.compiere.model.GridFieldVO.initFinish(GridFieldVO.java:842)
at org.compiere.model.GridFieldVO.afterCreate(GridFieldVO.java:202)
at org.compiere.model.GridTabVO.createFields(GridTabVO.java:355)
at org.compiere.model.GridTabVO.getFields(GridTabVO.java:556)
at org.compiere.model.GridTab.loadFields(GridTab.java:366)
at org.compiere.model.GridTab.loadTab(GridTab.java:312)
at org.compiere.model.GridTab.initTab(GridTab.java:303)
at org.compiere.model.GridWindow.initTab(GridWindow.java:195)

The problem occurs in line 1752 of the class: org.compiere.util.DB.java

if (MTable.get (Env.getCtx (), hdr) .getColumn ("IsSOTrx") == null) {

It could be solved with the following code:

if (MTable.get (Env.getCtx (), hdr)! = null) {
if (MTable.get (Env.getCtx (), hdr) .getColumn ("IsSOTrx") == null) {
.......................
}
}
else {
noIsSOTrxColumn = true;
}
...............

Environment

None

Activity

Show:

Carlos Ruiz May 4, 2021 at 12:12 PM

Created pull request, the steps to reproduce are incomplete, to be able to reproduce it, it was necessary to configure:

Create a new Table: LUY_ProductLine

The table LUY_ProductLine must have configured Window and PO Window too.

Add new column LUY_ProductLine_ID to table M_Product

Then you need to create a reference for the LUY_ProductLine table, and then the column must be of type table or search and have assigned the reference

Add new field for LUY_ProductLine_ID column in Products window

When opening the Products window the following error occurs

The error is not visible for the user, is shown in console.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Created May 2, 2021 at 11:34 PM
Updated July 1, 2021 at 12:11 PM
Resolved May 7, 2021 at 10:25 AM