bug [ 1704212 ] order reserves at the wrong locator
This commit is contained in:
parent
2d17ff09d8
commit
d146950e0b
|
@ -1504,8 +1504,19 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
// Get default Location
|
// Get default Location
|
||||||
if (M_Locator_ID == 0)
|
if (M_Locator_ID == 0)
|
||||||
{
|
{
|
||||||
|
// try to take default locator for product first
|
||||||
|
// if it is from the selected warehouse
|
||||||
MWarehouse wh = MWarehouse.get(getCtx(), line.getM_Warehouse_ID());
|
MWarehouse wh = MWarehouse.get(getCtx(), line.getM_Warehouse_ID());
|
||||||
M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID();
|
M_Locator_ID = product.getM_Locator_ID();
|
||||||
|
if (M_Locator_ID!=0) {
|
||||||
|
MLocator locator = new MLocator(getCtx(), product.getM_Locator_ID(), get_TrxName());
|
||||||
|
//product has default locator defined but is not from the order warehouse
|
||||||
|
if(locator.getM_Warehouse_ID()!=wh.get_ID()) {
|
||||||
|
M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Update Storage
|
// Update Storage
|
||||||
if (!MStorage.add(getCtx(), line.getM_Warehouse_ID(), M_Locator_ID,
|
if (!MStorage.add(getCtx(), line.getM_Warehouse_ID(), M_Locator_ID,
|
||||||
|
|
Loading…
Reference in New Issue