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:
Carlos Ruiz 2012-03-27 21:01:14 -05:00
parent 10595f132f
commit 4368b0006d
2 changed files with 7 additions and 0 deletions

View File

@ -240,6 +240,11 @@ public class MRecentItem extends X_AD_RecentItem
String windowName = win.get_Translation("Name");
MTable table = MTable.get(getCtx(), getAD_Table_ID());
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 = "";
if (po.get_ColumnIndex("DocumentNo") > 0)
recordIdentifier = recordIdentifier + "_" + po.get_ValueAsString("DocumentNo");

View File

@ -170,6 +170,8 @@ public class DPRecentItems extends DashboardPanel implements EventListener {
int riShown = 0;
for (MRecentItem ri : ris) {
String label = ri.getLabel();
if (label == null)
continue;
ToolBarButton btnrecentItem = new ToolBarButton(String.valueOf(ri.getAD_RecentItem_ID()));
btnrecentItem.setLabel(label);
btnrecentItem.setImage(getIconFile());