details:   https://code.tryton.org/tryton/commit/5484d7e3b8e0
branch:    default
user:      Cédric Krier <[email protected]>
date:      Wed Dec 17 23:35:27 2025 +0100
description:
        Do not render details button on error message without details

        Closes #14426
diffstat:

 sao/src/common.js |  29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diffs (40 lines):

diff -r 33e65be32c54 -r 5484d7e3b8e0 sao/src/common.js
--- a/sao/src/common.js Wed Dec 17 16:13:44 2025 +0100
+++ b/sao/src/common.js Wed Dec 17 23:35:27 2025 +0100
@@ -3639,21 +3639,22 @@
                     'white-space': 'pre-wrap',
                     'word-break': 'break-all',
                 }));
-            alert_.append(jQuery('<p/>').append(jQuery('<a/>', {
-                'class': 'btn btn-default',
-                role: 'button',
-                'data-toggle': 'collapse',
-                'data-target': '#error-detail',
-                'aria-expanded': false,
-                'aria-controls': '#error-detail',
-            }).text(Sao.i18n.gettext("Details"))));
             if (details) {
-                alert_.append(jQuery('<p/>', {
-                    'class': 'collapse',
-                    id: 'error-detail',
-                }).append(jQuery('<pre/>', {
-                    'class': 'pre-scrollable',
-                }).text(details)));
+                alert_.append(
+                    jQuery('<p/>').append(jQuery('<a/>', {
+                        'class': 'btn btn-default',
+                        role: 'button',
+                        'data-toggle': 'collapse',
+                        'data-target': '#error-detail',
+                        'aria-expanded': false,
+                        'aria-controls': '#error-detail',
+                    }).text(Sao.i18n.gettext("Details"))))
+                    .append(jQuery('<p/>', {
+                        'class': 'collapse',
+                        id: 'error-detail',
+                    }).append(jQuery('<pre/>', {
+                        'class': 'pre-scrollable',
+                    }).text(details)));
             }
             jQuery('<a/>', {
                 'class': 'btn btn-link',

Reply via email to