IDEMPIERE-127 Implement Recent Items dashboard / Recent Items don't appear when a record was deleted with direct SQL DELETE
http://jira.idempiere.com/browse/IDEMPIERE-127
This commit is contained in:
parent
10595f132f
commit
4368b0006d
|
@ -240,6 +240,11 @@ public class MRecentItem extends X_AD_RecentItem
|
||||||
String windowName = win.get_Translation("Name");
|
String windowName = win.get_Translation("Name");
|
||||||
MTable table = MTable.get(getCtx(), getAD_Table_ID());
|
MTable table = MTable.get(getCtx(), getAD_Table_ID());
|
||||||
PO po = table.getPO(getRecord_ID(), null);
|
PO po = table.getPO(getRecord_ID(), null);
|
||||||
|
if (po == null) {
|
||||||
|
/* Recent Item was deleted (probably with direct SQL DELETE) */
|
||||||
|
this.deleteEx(true, null);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String recordIdentifier = "";
|
String recordIdentifier = "";
|
||||||
if (po.get_ColumnIndex("DocumentNo") > 0)
|
if (po.get_ColumnIndex("DocumentNo") > 0)
|
||||||
recordIdentifier = recordIdentifier + "_" + po.get_ValueAsString("DocumentNo");
|
recordIdentifier = recordIdentifier + "_" + po.get_ValueAsString("DocumentNo");
|
||||||
|
|
|
@ -170,6 +170,8 @@ public class DPRecentItems extends DashboardPanel implements EventListener {
|
||||||
int riShown = 0;
|
int riShown = 0;
|
||||||
for (MRecentItem ri : ris) {
|
for (MRecentItem ri : ris) {
|
||||||
String label = ri.getLabel();
|
String label = ri.getLabel();
|
||||||
|
if (label == null)
|
||||||
|
continue;
|
||||||
ToolBarButton btnrecentItem = new ToolBarButton(String.valueOf(ri.getAD_RecentItem_ID()));
|
ToolBarButton btnrecentItem = new ToolBarButton(String.valueOf(ri.getAD_RecentItem_ID()));
|
||||||
btnrecentItem.setLabel(label);
|
btnrecentItem.setLabel(label);
|
||||||
btnrecentItem.setImage(getIconFile());
|
btnrecentItem.setImage(getIconFile());
|
||||||
|
|
Loading…
Reference in New Issue