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

How to make pop ups after actions?

Suscribirse

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

Se marcó esta pregunta
popup
2 Respuestas
9319 Vistas
Avatar
Apiuser

So I read I can do this to create a popup at the top right of the screen:


def action(self):

​return { 'warning': {'title': 'Success', 'message': 'Warning works'}}


But it does not work for me... Do I need anything else or I'm doing something wrong, or is this functionality discontinued?


I'm calling the action with a button, and it actualy triggers, it is just the popup that does not work.

I'm on CE Odoo 15 currently, but would like to know from Odoo 14 till Odoo 17 (last version).


Thanks.


Places I checked:

https://www.odoo.com/forum/help-1/how-to-display-a-warning-popup-when-select-customer-150137

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

Plus other sources...

0
Avatar
Descartar
William Rogov

I want to add a popup that shows up when I use the "write" methode, the methode is called when the status of the status bar is changed:

from odoo import models, fields,api

from odoo.exceptions import ValidationError

import json



class labSample(models.Model):

_name = 'lab.sample'

_description = 'lab Sample (Base)'


name = fields.Char(string="Name", required=True)

sample_request_id = fields.Many2one('sample.request', string="Sample Request")

sample_request_line_id = fields.Many2one('sample.request.line', string="Sample Request Line", ondelete='cascade')

state= fields.Selection([

('draft', 'Draft'),

('progress', 'In progress'),

('done', 'Done'),

], string='Status', default='draft', required=True)

datum_test = fields.Date(string='Datum test')

uitvoerder = fields.Many2one('hr.employee', string='Uitvoerder')

required_for_done_fields = []


@api.constrains('state')

def _check_required_fields_on_done(self):

for record in self:

if record.state == 'done' and record.required_for_done_fields:

missing_fields = [

field for field in record.required_for_done_fields

if not getattr(record, field)

]

if missing_fields:

field_labels = ', '.join(self._fields[f].string for f in missing_fields)

raise ValidationError(

f"Je kan deze staal niet op 'Done' zetten zonder volgende ingevulde velden: {field_labels}."

)

def write(self, vals):

result = super().write(vals)

if 'state' in vals:

self._notify_success_message()

return result



Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,

To generate a sticky notification on the right side of the screen in Odoo, please try with below code:

def action(self):

    return {

                'type': 'ir.actions.client',

                'tag': 'display_notification',

                'params': {

                    'message': _("Warning works"),

                    'type': 'success',

                },

            }


Hope it helps



3
Avatar
Descartar
Apiuser
Autor

Works like a charm!
Does this mean that the other way I was trying is deprecated?

Avatar
Dương Nguyễn
Mejor respuesta

Need to return something like this, i copy this from mrp module in v15

return {

'type': 'ir.actions.client',

'tag': 'display_notification',

'params': {

'title': _("Note that archived work center(s): '%s' is/are still linked to active Bill of Materials, which means that operations can still be planned on it/them. "

"To prevent this, deletion of the work center is recommended instead.", filtered_workcenters),

'type': 'warning',

'sticky': True, #True/False will display for few seconds if false

'next': {'type': 'ir.actions.act_window_close'},

},

}

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

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

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Translate pop up in Odoo 14
popup
Avatar
0
nov 23
2057
Edit Time Off Popup from dashboard
popup
Avatar
Avatar
1
sept 23
2978
automatic popup newsletter in odoo website
popup
Avatar
Avatar
1
jul 22
1125
Button form popup
popup
Avatar
2
jun 20
3962
show popup message wiht Yes and No buttons
popup
Avatar
Avatar
Avatar
2
abr 20
10560
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