diff --git a/src-db/database/model/triggers/C_CONVERSION_RATE_DOC_TRG2.xml b/src-db/database/model/triggers/C_CONVERSION_RATE_DOC_TRG2.xml
index fe2ae9fd0b..d36d7dba41 100644
--- a/src-db/database/model/triggers/C_CONVERSION_RATE_DOC_TRG2.xml
+++ b/src-db/database/model/triggers/C_CONVERSION_RATE_DOC_TRG2.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
   <database name="TRIGGER C_CONVERSION_RATE_DOC_TRG2">
-    <trigger name="C_CONVERSION_RATE_DOC_TRG2" table="C_CONVERSION_RATE_DOCUMENT" fires="after" insert="true" update="true" delete="false" foreach="statement">
+    <trigger name="C_CONVERSION_RATE_DOC_TRG2" table="C_CONVERSION_RATE_DOCUMENT" fires="after" insert="true" update="true" delete="false" foreach="row">
       <body><![CDATA[
 /*************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
@@ -14,7 +14,7 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2012 Openbravo SLU
+* All portions are Copyright (C) 2012-2021 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -26,19 +26,24 @@ BEGIN
     END IF;
 
     -- Invoice check
+    if (:new.c_invoice_id is not null) then
       SELECT count(*)
       INTO v_Count
       FROM (
         SELECT count(*)
         FROM c_conversion_rate_document crd join c_invoice i on (crd.c_invoice_id = i.c_invoice_id)
         WHERE crd.fin_payment_id is null and crd.aprm_finacc_transaction_v_id is null
+        and i.c_invoice_id=:new.c_invoice_id
         GROUP BY crd.c_currency_id, crd.c_currency_id_to, crd.c_invoice_id
         HAVING count(*) > 1) A;
 
      IF v_Count > 0 THEN
        RAISE_APPLICATION_ERROR(-20000, '@DuplicateDocumentExchangeRate@');
      END IF;
+  end if;
 
+  
+   if (:new.fin_payment_id is not null) then
      -- Payment check
      SELECT count(*)
      INTO v_Count
@@ -46,26 +51,31 @@ BEGIN
        SELECT count(*)
        FROM c_conversion_rate_document crd join fin_payment p on (crd.fin_payment_id = p.fin_payment_id)
        WHERE crd.c_invoice_id is null and crd.aprm_finacc_transaction_v_id is null
+       and p.fin_payment_id=:new.fin_payment_id
        GROUP BY crd.c_currency_id, crd.c_currency_id_to, crd.fin_payment_id
        HAVING count(*) > 1) A;
 
      IF v_Count > 0 THEN
        RAISE_APPLICATION_ERROR(-20000, '@DuplicateDocumentExchangeRate@');
      END IF;
+   end if;
 
    -- Transaction check
+   if (:new.fin_finacc_transaction_id is not null) then
      SELECT count(*)
      INTO v_Count
      FROM (
        SELECT count(*)
        FROM c_conversion_rate_document crd join fin_finacc_transaction ft on (crd.aprm_finacc_transaction_v_id = ft.fin_finacc_transaction_id)
        WHERE crd.c_invoice_id is null and crd.fin_payment_id is null
+       and ft.fin_finacc_transaction_id =:new.fin_finacc_transaction_id
        GROUP BY crd.c_currency_id, crd.c_currency_id_to, crd.aprm_finacc_transaction_v_id
        HAVING count(*) > 1) A;
      
      IF v_Count > 0 THEN
        RAISE_APPLICATION_ERROR(-20000, '@DuplicateDocumentExchangeRate@');
      END IF;
+  end if;
 
 END C_CONVERSION_RATE_DOC_TRG2
 ]]></body>
