IDEMPIERE-3898 Wrong value for Print Format Item when exporting to excel and AD_Column_ID > 0 with type != field

This commit is contained in:
Diego Ruiz 2019-02-19 11:32:53 +01:00
parent 9aeb90550f
commit c0b2c25de3
2 changed files with 10 additions and 3 deletions

View File

@ -58,10 +58,14 @@ extends AbstractExcelExporter
m_printData.setRowIndex(row); m_printData.setRowIndex(row);
// //
MPrintFormatItem item = m_printFormat.getItem(col); MPrintFormatItem item = m_printFormat.getItem(col);
int AD_Column_ID = item.getAD_Column_ID();
Object obj = null; Object obj = null;
if (AD_Column_ID > 0)
obj = m_printData.getNode(Integer.valueOf(AD_Column_ID)); if (item.isTypeField() || item.isTypePrintFormat() && item.isImageField()) {
int AD_Column_ID = item.getAD_Column_ID();
if (AD_Column_ID > 0)
obj = m_printData.getNode(Integer.valueOf(AD_Column_ID));
}
if (obj != null && obj instanceof PrintDataElement) { if (obj != null && obj instanceof PrintDataElement) {
return (PrintDataElement)obj; return (PrintDataElement)obj;
} }

View File

@ -649,6 +649,9 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem
setImageIsAttached(false); setImageIsAttached(false);
setImageURL(null); setImageURL(null);
} }
if (!isTypeField() && !isTypePrintFormat() && !isImageField()) {
setAD_Column_ID(0);
}
return true; return true;
} // beforeSave } // beforeSave