IDEMPIERE-3649 Location can use CityID from another tenant

This commit is contained in:
Nicolas Micoud 2018-03-05 21:22:25 +01:00
parent 1153e4d159
commit 1e20f020ab
1 changed files with 2 additions and 2 deletions

View File

@ -647,8 +647,8 @@ public class MLocation extends X_C_Location implements Comparator<Object>
if (getC_City_ID() <= 0 && getCity() != null && getCity().length() > 0) { if (getC_City_ID() <= 0 && getCity() != null && getCity().length() > 0) {
int city_id = DB.getSQLValue( int city_id = DB.getSQLValue(
get_TrxName(), get_TrxName(),
"SELECT C_City_ID FROM C_City WHERE C_Country_ID=? AND COALESCE(C_Region_ID,0)=? AND Name=?", "SELECT C_City_ID FROM C_City WHERE C_Country_ID=? AND COALESCE(C_Region_ID,0)=? AND Name=? AND AD_Client_ID IN (0,?)",
new Object[] {getC_Country_ID(), getC_Region_ID(), getCity()}); new Object[] {getC_Country_ID(), getC_Region_ID(), getCity(), getAD_Client_ID()});
if (city_id > 0) if (city_id > 0)
setC_City_ID(city_id); setC_City_ID(city_id);
} }