IDEMPIERE-6315 WPAttributeDialog: added filter for M_Product_ID when loading Lots (#2557)

On M_Lot M_Product_ID is mandatory, so the filter for M_Product_ID is needed when loading Lots
This commit is contained in:
Macchiarch 2024-11-27 15:08:20 +01:00 committed by Carlos Ruiz
parent b6e25d71f8
commit a875f477ed
1 changed files with 3 additions and 2 deletions

View File

@ -412,10 +412,11 @@ public class WPAttributeDialog extends Window implements EventListener<Event>
+ "FROM M_Lot l "
+ "WHERE EXISTS (SELECT M_Product_ID FROM M_Product p "
+ "WHERE p.M_AttributeSet_ID=" + m_masi.getM_AttributeSet_ID()
+ " AND p.M_Product_ID=l.M_Product_ID)";
+ " AND p.M_Product_ID=l.M_Product_ID) "
+ " AND l.M_Product_ID = ? ";
fieldLot = new Listbox();
fieldLot.setMold("select");
KeyNamePair[] keyNamePairs = DB.getKeyNamePairs(sql, true);
KeyNamePair[] keyNamePairs = DB.getKeyNamePairs(sql, true, m_M_Product_ID);
for (KeyNamePair pair : keyNamePairs) {
fieldLot.appendItem(pair.getName(), pair.getKey());
}