IDEMPIERE-5574 Drop Ship BPartner must have opposite IsSOTrx logic on Info Window (#1673)

This commit is contained in:
Carlos Ruiz 2023-02-18 16:20:24 +01:00 committed by GitHub
parent 3e957e6c1f
commit 9efd93d08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 4 deletions

View File

@ -34,6 +34,8 @@ import org.adempiere.webui.panel.InfoPanel;
import org.adempiere.webui.panel.InfoPaymentPanel;
import org.adempiere.webui.panel.InfoProductPanel;
import org.compiere.model.GridField;
import org.compiere.model.I_C_Order;
import org.compiere.model.I_M_InOut;
import org.compiere.model.Lookup;
import org.compiere.model.MDocType;
import org.compiere.model.MInfoWindow;
@ -169,9 +171,24 @@ public class DefaultInfoFactory implements IInfoFactory {
}
else if (col.equals("C_BPartner_ID"))
{
String originalIsSOTrx = null;
try {
if ( field != null
&& I_C_Order.COLUMNNAME_DropShip_BPartner_ID.equals(field.getColumnName())
&& field.getGridTab() != null
&& ( field.getGridTab().getTableName().equals(I_C_Order.Table_Name)
|| field.getGridTab().getTableName().equals(I_M_InOut.Table_Name))) {
originalIsSOTrx = Env.getContext(Env.getCtx(), lookup.getWindowNo(), "IsSOTrx");
String tempIsSOTrx = ("Y".equals(originalIsSOTrx) ? "N" : "Y");
Env.setContext(Env.getCtx(), lookup.getWindowNo(), "IsSOTrx", tempIsSOTrx);
}
InfoWindow infoWindow = new InfoBPartnerWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, multiSelection, whereClause, AD_InfoWindow_ID, true, field);
if (infoWindow.loadedOK())
return infoWindow;
} finally {
if (originalIsSOTrx != null)
Env.setContext(Env.getCtx(), lookup.getWindowNo(), "IsSOTrx", originalIsSOTrx);
}
boolean isSOTrx = true; // default