FR [ 2092739 ] When I select a product, default BOM and WF should be set
This commit is contained in:
parent
351edc13ea
commit
4d71731b43
|
@ -23,6 +23,7 @@ import java.util.Properties;
|
|||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.model.MUOMConversion;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.wf.MWorkflow;
|
||||
|
@ -33,8 +34,7 @@ import org.compiere.wf.MWorkflow;
|
|||
* @author Victor Perez
|
||||
* @version $Id: CalloutOrder.java,v 1.23 2004/08/27 21:24:12 vpj-cd Exp $
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
* <li>BF [ 1983657 ] "Data found" error on creating new MO (manually)
|
||||
* @author Teo Sarca, www.arhipac.ro
|
||||
*/
|
||||
public class CalloutOrder extends CalloutEngine
|
||||
{
|
||||
|
@ -146,5 +146,22 @@ public class CalloutOrder extends CalloutEngine
|
|||
return "";
|
||||
}
|
||||
|
||||
public String product (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
|
||||
{
|
||||
if (isCalloutActive() || value == null)
|
||||
return "";
|
||||
|
||||
MProduct product = MProduct.get(ctx, ((Number)value).intValue());
|
||||
if (product == null)
|
||||
return "";
|
||||
|
||||
int workflow_id = MWorkflow.getWorkflowSearchKey(ctx, product);
|
||||
mTab.setValue(MPPOrder.COLUMNNAME_AD_Workflow_ID, workflow_id > 0 ? workflow_id : null);
|
||||
|
||||
int bom_id = MPPProductBOM.getBOMSearchKey(ctx, product);
|
||||
mTab.setValue(MPPOrder.COLUMNNAME_PP_Product_BOM_ID, bom_id > 0 ? bom_id : null);
|
||||
|
||||
return "";
|
||||
}
|
||||
} // CalloutOrder
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
-- Aug 27, 2008 1:30:17 PM EEST
|
||||
-- Update PP_Order.M_Product_ID column: set callout and reference value
|
||||
UPDATE AD_Column SET Callout='org.eevolution.model.CalloutOrder.product',Updated=TO_DATE('2008-08-27 13:30:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53623
|
||||
;
|
||||
UPDATE AD_Column SET AD_Reference_Value_ID=211,Updated=TO_DATE('2008-08-27 13:31:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53623
|
||||
;
|
|
@ -0,0 +1,6 @@
|
|||
-- Aug 27, 2008 1:30:18 PM EEST
|
||||
-- Update PP_Order.M_Product_ID column: set callout and reference value
|
||||
UPDATE AD_Column SET Callout='org.eevolution.model.CalloutOrder.product',Updated=TO_TIMESTAMP('2008-08-27 13:30:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53623
|
||||
;
|
||||
UPDATE AD_Column SET AD_Reference_Value_ID=211,Updated=TO_TIMESTAMP('2008-08-27 13:31:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53623
|
||||
;
|
Loading…
Reference in New Issue