BF [2957215] - Wrong #AD_User_ID when user with the same name from two Ten.

https://sourceforge.net/tracker/?func=detail&aid=2957215&group_id=176962&atid=879332
This commit is contained in:
trifonnt 2010-02-23 13:34:19 +00:00
parent c7b42af6dd
commit b6fe0e9ee8
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,7 @@ import org.compiere.db.CConnectionEditor;
import org.compiere.grid.ed.VComboBox; import org.compiere.grid.ed.VComboBox;
import org.compiere.grid.ed.VDate; import org.compiere.grid.ed.VDate;
import org.compiere.model.MSystem; import org.compiere.model.MSystem;
import org.compiere.model.MUser;
import org.compiere.print.CPrinter; import org.compiere.print.CPrinter;
import org.compiere.swing.CButton; import org.compiere.swing.CButton;
import org.compiere.swing.CDialog; import org.compiere.swing.CDialog;
@ -758,6 +759,14 @@ public final class ALogin extends CDialog
return; return;
log.config(": " + client); log.config(": " + client);
m_comboActive = true; m_comboActive = true;
// @Trifon - Set Proper "#AD_Client_ID", #AD_User_ID and "#SalesRep_ID"
// https://sourceforge.net/tracker/?func=detail&aid=2957215&group_id=176962&atid=879332
Env.setContext(m_ctx, "#AD_Client_ID", client.getKey());
MUser user = MUser.get (m_ctx, userTextField.getText(), new String (passwordField.getPassword()) );
if (user != null) {
Env.setContext(m_ctx, "#AD_User_ID", user.getAD_User_ID() );
Env.setContext(m_ctx, "#SalesRep_ID", user.getAD_User_ID() );
}
// //
KeyNamePair[] orgs = m_login.getOrgs(client); KeyNamePair[] orgs = m_login.getOrgs(client);
// delete existing cleint items // delete existing cleint items