Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

odoo 16 pop up message

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
3 Respuestas
7687 Vistas
Avatar
Nahid Jawad Angon

how can I show a popup message when click defalut save button in odoo. here i want to add a confirmation message when clicking the default save button.

how can I do that if anyone know please help me. i can not find any solution regarding this.

0
Avatar
Descartar
Avatar
user
Mejor respuesta

Hello,


Try this


from odoo import models, fields, api
from odoo.exceptions import ValidationError


class MyClass(models.Model):
_name = 'my.class'
name = fields.Char('Name')

@api.model
def create(self, vals):
if not self.name:
raise ValidationError("Write your message ")
return super(MyClass, self).create(vals)


@api.model
def write(self, vals):
if not self.name:
raise ValidationError("Write your message ")
return super(MyClass, self).create(vals)





In the provided code, if we want the message after creating a record and then save use the create method, and if we want the message after editing the created record we can use the write method


0
Avatar
Descartar
Avatar
shubham shiroya
Mejor respuesta
  1. Create a new module or identify the existing module where you want to add the customization.

  2. Inside your module, create a new JavaScript file, let's call it custom_script.js, and add your custom JavaScript code in it. For example:


odoo.define('your_module.custom_script', function (require) {
"use strict";

var FormController = require('web.FormController');
var core = require('web.core');
var Dialog = require('web.Dialog');

FormController.include({
_saveRecord: function () {
var self = this;
var confirmMessage = "Are you sure you want to save?"; # Custom confirmation message

Dialog.confirm(this, confirmMessage, {
confirm_callback: function () {
self._super.apply(self, arguments);
},
cancel_callback: function () {
#Perform actions when the user cancels the save action
# ...
},
});
},
});
});

In the above code, we define a new JavaScript module named your_module.custom_script. We include the necessary dependencies web.FormController, web.core, and web.Dialog. We extend the FormController and override the _saveRecord method, which is responsible for handling the Save action.

Inside the overridden method, we create a confirmation dialog using web.Dialog.confirm(). The confirm_callback function is executed when the user confirms the save action, and the default save behavior is invoked. The cancel_callback function is executed when the user cancels the save action, allowing you to perform any additional actions if needed.

0
Avatar
Descartar
Nahid Jawad Angon
Autor

js not working here I added js file in manifest
"assets": {
"web.assets_backend": [
"popup_js/static/src/js/popup.js",
],
},
but js not working and added your js code in popup.js. do i need any other thing to work this js?

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,

Please refer this forum answer:

https://www.odoo.com/forum/help-1/how-can-i-make-a-popup-warning-message-93419

Regards

0
Avatar
Descartar
Nahid Jawad Angon
Autor

In this forum they are showing pop up in wizard. but i want to show popup on clicking default save button. Though save button is not visible so I can not define the confirmation message and i applied js but its also not working.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now