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

Using @api.onchange for Helpdesk ticket stage changes

Suscribirse

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

Se marcó esta pregunta
widgetonchangestatusbarhelpdeskstage_id
5 Respuestas
7613 Vistas
Avatar
Andrew Pearson

I'm trying to make it so when an IT tech is assigned to a Helpdesk ticket, the Ticket's stage goes from 'New' to 'Assigned'.  However, when I add the tech, the stage doesn't change.  I have seen that 'onchange' doesn't work in the event that you have a clickable Statusbar widget, which we have set up for our tickets.  Unfortunately, I haven't seen a good workaround, but perhaps I'm missing something.  Can anyone give me some suggestions?

@api.onchange('user_id')
def tmg_assigned_user_id(self)
        self.ensure_one()
        for ticket in self:
                if ticket.user_id:
                    ticket.stage_id.sequence = 1

0
Avatar
Descartar
Ray Carnes (ray)

Why are you changing the sequence of the stage_id? What happens if you just change the stage_id to 1? (Also, tip: Ideally you should SEARCH for the Assigned status to make sure you have the correct ID)

Andrew Pearson
Autor

We wanted to make the stage change automatically when a tech is assigned to a ticket, so that way, the ticket status just doesn't stay as 'New'. If I just change the stage_id to 1, nothing happens as well. Our 'Assigned' status is under sequence 1, while 'New' is 0 and so on

Ray Carnes (ray)

I understand what you want to do, I just wanted to point out that what your code is trying to do is change the sequence of the stage, not change the stage. Seems like you've tried ticket.stage_id = {something} also?

Andrew Pearson
Autor

Thanks for bringing that up. I actually did just notice that today. I didn't realize that's what was happening. I have tried ticket.stage_id = 'In Progress' but unfortunately to no avail. I think this also just ended up changing the ticket status name in sequence 0 to "In Progress"

Avatar
Andrew Pearson
Autor Mejor respuesta

@subbarao

I wasn't able to get it to work.  It must be my logic at this point.

@api.multi
def write(self,vals):
      if vals.get('user_id'):
           vals['stage_id] = 1
      return super(HelpdeskTicket, self).write(vals)
0
Avatar
Descartar
Andrew Pearson
Autor

I actually was able to get this to work. The write method also needed the create method to go along with it. Turns out my code was right after all. Thanks for the help

Andrew Pearson
Autor

The create method looks exactly the same but just has @api.model instead

Avatar
subbarao
Mejor respuesta

Hello Andrew,

Instead of doing it on onchange use write method.

@api.multi

def write(self, vals):

    if vals.get('user_id',False):

    ###        write your logic here

    return super(your_class_name, self).write(vals)



1
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
widget="statusbar" doesn't work Resuelto
widget statusbar
Avatar
4
mar 20
154
How can I show only current status in statusbar? Resuelto
widget statusbar odoo8.0
Avatar
Avatar
2
sept 16
14336
State statusbar in form view alligns left
xml state statusbar helpdesk
Avatar
Avatar
1
mar 15
8016
Modify status visibility with statusbar_visible
widget statusbar dynamically visible odoo12
Avatar
Avatar
1
jul 23
11660
Perform “actions” in status bar widget
action widget statusbar odoo odooV8
Avatar
0
abr 16
5930
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.

Sitio web hecho con

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