Función oculta: ☑️ CONFIRMAR antes de click | MENSAJE de CONFIRMACIÓN |Truco XML programación Odoo

Función oculta: ☑️ CONFIRMAR antes de click | MENSAJE de CONFIRMACIÓN |Truco XML programación Odoo

How to Add a Confirmation Dialog Before Cancelling a Quotation

Introduction to the Problem

  • The speaker introduces a trick for displaying a confirmation dialog before cancelling a quotation in the sales module, addressing the lack of user prompts when using the standard cancel button.

Implementing the Confirmation Dialog

  • The current functionality does not ask users if they are sure about cancelling; it simply cancels. The goal is to prompt users with a confirmation message.
  • The speaker demonstrates how to activate this feature by identifying the button (action cancel) where the dialog will be implemented.

Steps to Add Confirmation

  • In edit mode, locate the action cancel button and add code: confirm = "Are you sure you want to continue?" This sets up the text for the confirmation dialog.
  • After saving changes, refreshing allows testing of the new functionality. A dialog appears asking for confirmation with options for Yes or No.

Testing and Expanding Functionality

  • The speaker shows how to replicate this functionality on another button (action Draft), ensuring consistency across different actions.
  • By changing text and repeating similar steps, users can customize dialogs as needed, demonstrating ease of implementation.
Video description

En este video aprenderás un truco de programación Odoo para poder agregar un cuadro de diálogo o mensaje de confirmación desde el código XML al momento de hacer clic en un botón o action dentro del formulario. Este mensaje popup o confirm message muestra un wizard con las opciones "Si" o "No" antes de realiza la acción predeterminada para el botón. 🌐 Hosting que utilizo: linode.gvw92c.net/RyqgXv 🎤 El micrófono que utilizo: https://amzn.to/3NK26Qw ☕️ Apoya a este canal con un Café: https://ko-fi.com/josuheuh 00:00 Introducción dialogo de confirmación en botón Odoo 00:48 Add confirm dialog box on button or action from XML 01:54 Mostrar cuadro de dialogo 02:25 Agregar confirmación en botón del formulario