diff --git a/addons/payment/static/src/js/manage_form.js b/addons/payment/static/src/js/manage_form.js index 80875d221b7..8cdb1a9e75c 100644 --- a/addons/payment/static/src/js/manage_form.js +++ b/addons/payment/static/src/js/manage_form.js @@ -68,6 +68,53 @@ odoo.define('payment.manage_form', require => { }); }, + /** + * Build the confirmation dialog based on the linked records' information. + * + * @private + * @param {Array} linkedRecordsInfo - The list of information about linked records. + * @param confirmCallback - The callback method called when the user clicks on the + * confirmation button. + * @return {object} + */ + _buildConfirmationDialog: function (linkedRecordsInfo, confirmCallback) { + const $dialogContentMessage = $( + '', {text: _t("Are you sure you want to delete this payment method?")} + ); + if (linkedRecordsInfo.length > 0) { // List the documents linked to the token. + $dialogContentMessage.append($('
')); + $dialogContentMessage.append($( + '', {text: _t("It is currently linked to the following documents:")} + )); + const $documentInfoList = $('