Fixes issue 0015801: the system is blocked when run Create AP Expense Invoices
authorAdrián Romero <adrianromero@openbravo.com>
Thu, 03 Feb 2011 16:13:02 +0100
changeset 10359 fab5abc10d9c
parent 10358 f1baba469270
child 10360 2e6e4c3dbc17
Fixes issue 0015801: the system is blocked when run Create AP Expense Invoices
It has been rewritten the SQL sentence that gets the sequence values to not to lock the C_DOCTYPE table because it is not necessary and is the cause of the issue
src-db/database/model/functions/AD_SEQUENCE_DOCTYPE.xml
--- a/src-db/database/model/functions/AD_SEQUENCE_DOCTYPE.xml	Thu Feb 03 13:35:55 2011 +0100
+++ b/src-db/database/model/functions/AD_SEQUENCE_DOCTYPE.xml	Thu Feb 03 16:13:02 2011 +0100
@@ -65,11 +65,10 @@
   RETURN;
 END IF;
 -- Get the numbers
-SELECT s.AD_Sequence_ID, s.CurrentNext, s.Prefix, s.Suffix
-INTO v_Sequence_ID, v_NextNo, v_Prefix, v_Suffix
-FROM C_DocType d, AD_Sequence s
-WHERE d.C_DocType_ID=p_DocType_ID -- parameter
-  AND d.DocNoSequence_ID=s.AD_Sequence_ID  AND s.IsActive='Y'  AND s.IsTableID='N'  AND s.IsAutoSequence='Y'  FOR UPDATE OF CurrentNext;
+SELECT s.CurrentNext, s.Prefix, s.Suffix
+INTO v_NextNo, v_Prefix, v_Suffix
+FROM AD_Sequence s
+WHERE s.AD_Sequence_ID = v_Sequence_ID  AND s.IsActive='Y'  AND s.IsTableID='N'  AND s.IsAutoSequence='Y'  FOR UPDATE OF CurrentNext;
 
   IF p_Update_Next='Y' THEN
     UPDATE AD_Sequence