diff --git a/migration/i1.0a-release/oracle/201304131924_IDEMPIERE-790.sql b/migration/i1.0a-release/oracle/201304131924_IDEMPIERE-790.sql new file mode 100644 index 0000000000..868e40aca6 --- /dev/null +++ b/migration/i1.0a-release/oracle/201304131924_IDEMPIERE-790.sql @@ -0,0 +1,12 @@ +-- Apr 13, 2013 7:23:49 PM COT +-- IDEMPIERE-790 Voiding PO should unlink SO it was created from +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2013-04-13 19:23:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55322 +; + +-- Apr 13, 2013 7:24:14 PM COT +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2013-04-13 19:24:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55323 +; + +SELECT register_migration_script('201304131924_IDEMPIERE-790.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201304131924_IDEMPIERE-790.sql b/migration/i1.0a-release/postgresql/201304131924_IDEMPIERE-790.sql new file mode 100644 index 0000000000..787f6b8a7c --- /dev/null +++ b/migration/i1.0a-release/postgresql/201304131924_IDEMPIERE-790.sql @@ -0,0 +1,12 @@ +-- Apr 13, 2013 7:23:49 PM COT +-- IDEMPIERE-790 Voiding PO should unlink SO it was created from +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2013-04-13 19:23:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55322 +; + +-- Apr 13, 2013 7:24:14 PM COT +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2013-04-13 19:24:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55323 +; + +SELECT register_migration_script('201304131924_IDEMPIERE-790.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index 40c4d3e5e6..6ec34c99e1 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -2401,6 +2401,11 @@ public class MOrder extends X_C_Order implements DocAction if (m_processMsg != null) return false; + if (getLink_Order_ID() > 0) { + MOrder so = new MOrder(getCtx(), getLink_Order_ID(), get_TrxName()); + so.setLink_Order_ID(0); + so.saveEx(); + } MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID); for (int i = 0; i < lines.length; i++) { @@ -2418,6 +2423,11 @@ public class MOrder extends X_C_Order implements DocAction { deleteMatchPOCostDetail(line); } + if (line.getLink_OrderLine_ID() > 0) { + MOrderLine soline = new MOrderLine(getCtx(), line.getLink_OrderLine_ID(), get_TrxName()); + soline.setLink_OrderLine_ID(0); + soline.saveEx(); + } } // update taxes