commit 38a13cf7beebbb5c8d1010395c68ed433aa0752c
Author: Adrián Romero <adrian.romero@openbravo.com>
Date:   Wed Mar 4 13:08:04 2020 +0100

    Fixes ISSUE-0043414: Improve OB.UTIL.showAlert to allow custom message and custom message timeout

diff --git a/web/org.openbravo.mobile.core/source/utils/ob-utilitiesui.js b/web/org.openbravo.mobile.core/source/utils/ob-utilitiesui.js
index b821d407..13d63feb 100644
--- a/web/org.openbravo.mobile.core/source/utils/ob-utilitiesui.js
+++ b/web/org.openbravo.mobile.core/source/utils/ob-utilitiesui.js
@@ -86,6 +86,7 @@ enyo.kind({
      * @param  {[type]} keepVisible false: the message will be hiden after some time. true: you will execute the hide() function of the returned object when the line must dissapear
      * @param  {[type]} idMessage   a unique identifier for this message
      * @param  {[type]} hidesIdMessage destroys any message present in the bubble of messages with this id
+     * @param  {[type]} customTimeout sets a custom timeout to hide the messages. Only used in custom type alerts.
      * @return {[type]}             the OB.UTIL.alertLine created and added to the bubble of messages
      */
     display: function(
@@ -94,7 +95,8 @@ enyo.kind({
       type,
       keepVisible,
       idMessage,
-      hidesIdMessage
+      hidesIdMessage,
+      customTimeout
     ) {
       if (!type) {
         type = 'alert-warning';
@@ -113,12 +115,20 @@ enyo.kind({
       for (i = 0; i < componentsArray.length; i++) {
         var element = componentsArray[i];
         // if this message hides another idMessage, destroy that message
-        if (element.idMessage === hidesIdMessage) {
+        if (
+          element.idMessage !== undefined &&
+          element.idMessage !== null &&
+          element.idMessage === hidesIdMessage
+        ) {
           element.destroy();
           continue;
         }
         // we don't want to annoy the user... do not repeat error and warning messages in the bubble
-        if (type === 'alert-warning' || type === 'alert-error') {
+        if (
+          type === 'alert-warning' ||
+          type === 'alert-error' ||
+          type === 'custom'
+        ) {
           if (element.txt === txt) {
             element.destroy();
           }
@@ -134,7 +144,8 @@ enyo.kind({
           txt: txt,
           type: type,
           keepVisible: keepVisible,
-          idMessage: idMessage
+          idMessage: idMessage,
+          customTimeout: customTimeout
         })
         .render();
 
@@ -193,6 +204,9 @@ enyo.kind({
           ? OB.MobileApp.model.get('permissions').OBMOBC_AlertTimeoutForError
           : 4000;
         break;
+      case 'custom':
+        destroyTimeout = this.customTimeout ? this.customTimeout : 5000;
+        break;
       default:
         OB.error(
           "DEVELOPER: The message of type '" +
