IDEMPIERE-4584 : InfoProduct throws "Attempted to access nonexistent … (#460)

* IDEMPIERE-4584 : InfoProduct throws "Attempted to access nonexistent ListModelTable field at 2, -1" if no IsInstanceAttribute column

* IDEMPIERE-4584 : fix test of column index

Co-Authored-By: hengsin <152246+hengsin@users.noreply.github.com>

Co-authored-by: hengsin <152246+hengsin@users.noreply.github.com>
This commit is contained in:
Nicolas Micoud 2020-12-12 06:47:06 +01:00 committed by GitHub
parent 3013819d5a
commit a7fbe30441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -52,7 +52,7 @@ public class InfoProductWindow extends InfoWindow {
/**
*
*/
private static final long serialVersionUID = -7892916038089331016L;
private static final long serialVersionUID = -640644572459126094L;
protected Tabbox tabbedPane;
protected WListbox warehouseTbl;
@ -357,11 +357,13 @@ public class InfoProductWindow extends InfoWindow {
}
}
Object value = contentPanel.getValueAt(row, findColumnIndex("IsInstanceAttribute"));
if (value != null && value.toString().equals("true")) {
m_PAttributeButton.setEnabled(true);
} else {
m_PAttributeButton.setEnabled(false);
m_PAttributeButton.setEnabled(false);
int colIdx = findColumnIndex("IsInstanceAttribute");
if (colIdx >= 0) {
Object value = contentPanel.getValueAt(row, colIdx);
if (value != null && value.toString().equals("true"))
m_PAttributeButton.setEnabled(true);
}
}
}