FR [ 2086964 ] Product Is BOM should be auto updated

This commit is contained in:
teo_sarca 2008-09-01 15:15:21 +00:00
parent de88152f83
commit 1a02dd2547
3 changed files with 59 additions and 0 deletions

View File

@ -286,4 +286,37 @@ public class MPPProductBOM extends X_PP_Product_BOM
return false;
return true;
}
@Override
protected boolean afterDelete(boolean success) {
if (!success)
return false;
updateProduct();
return true;
}
@Override
protected boolean afterSave(boolean newRecord, boolean success) {
if (!success)
return false;
if (newRecord || is_ValueChanged("IsActive"))
{
updateProduct();
}
return true;
}
private void updateProduct()
{
int count = new Query(getCtx(), Table_Name, "M_Product_ID=? AND IsActive=?", get_TrxName())
.setParameters(new Object[]{getM_Product_ID(), "Y"})
.count();
MProduct product = new MProduct(getCtx(), getM_Product_ID(), get_TrxName());
product.setIsBOM(count > 0);
product.saveEx();
}
} // MPPProductBOM

View File

@ -0,0 +1 @@
-- Sep 1, 2008 3:49:12 PM EEST -- UPDATE AD_Field SET SortNo=1.000000000000,Updated=TO_DATE('2008-09-01 15:48:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=53751 ; -- Sep 1, 2008 6:05:39 PM EEST -- UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2008-09-01 18:05:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=53592 ; -- Sep 1, 2008 6:05:43 PM EEST -- UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2008-09-01 18:05:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=53890 ; -- Sep 1, 2008 6:05:46 PM EEST -- UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2008-09-01 18:05:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=3743 ; -- Sep 1, 2008 6:05:52 PM EEST -- UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2008-09-01 18:05:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11782 ;

View File

@ -0,0 +1,25 @@
-- Sep 1, 2008 3:49:12 PM EEST
--
UPDATE AD_Field SET SortNo=1.000000000000,Updated=TO_TIMESTAMP('2008-09-01 15:48:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=53751
;
-- Sep 1, 2008 6:05:39 PM EEST
--
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2008-09-01 18:05:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=53592
;
-- Sep 1, 2008 6:05:43 PM EEST
--
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2008-09-01 18:05:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=53890
;
-- Sep 1, 2008 6:05:46 PM EEST
--
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2008-09-01 18:05:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=3743
;
-- Sep 1, 2008 6:05:52 PM EEST
--
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2008-09-01 18:05:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11782
;