Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Food & Hospitality
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Guest House
    • Distribuidor de bebidas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consulting
    • Accounting Firm
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Trades
    • Handyman
    • Hardware y asistencia informática
    • Solar Energy Systems
    • Zapatero
    • Servicios de limpieza
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

What is the _track proprerty of mail.thread model used for ?

Suscribirse

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

Se marcó esta pregunta
followermailmessagingv7track
4 Respuestas
29669 Vistas
Avatar
Nicolas Bessi

In the mail.thread model _trackpropety is defined. It as the following doc `

# Automatic logging system if mail installed
# _track = {
#   'field': {
#       'module.subtype_xml': lambda self, cr, uid, obj, context=None: obj[state] == done,
#       'module.subtype_xml2': lambda self, cr, uid, obj, context=None: obj[state] != done,
#   },
#   'field2': {
#       ...
#   },
# }

`

But his puprose and usage is not really clear.

3
Avatar
Descartar
Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Mejor respuesta

As per my knowledge it keeps track on state. When state is changed you can see message at bottom of your page.


Let's take Sale Order as example.

When you confirm Sale Quotation, you can see message Quotation confirmed in message list.

You can see _track in sale.py

_track = {
    'state': {
        'sale.mt_order_confirmed': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['manual', 'progress'],
        'sale.mt_order_sent': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['sent']
    },

Here, mt_order_confirmed & mt_order_sent is an ID of record of object mail.message.subtype in sale_data.xml

Correct me if I am wrong.

Thank you.

13
Avatar
Descartar
Avatar
Andreas Brueckl
Mejor respuesta

_track on the object is used to track events related to a document (an invoice has been paid, an opportunity is won, a task is blocked, ...). Users can follow events, represented by a mail.message.subtype, on any object.

It's different from the track_visibility attribute that you can define on a field which is used to track changes on this field. (e.g. Stage : Proposition -> Negociation)

Both _track and track_visibility produces messages on the document. Your object need to inherit from mail.thread.

If an object is inherited from 'mail.thread' then _track is used to send notifications. Therefore 'module.subtype_xml' is the related "Message Subtype". These subtypes have to be declared in XML. Here is an example:

<record id="subtype_xml" model="mail.message.subtype">
    <field name="name">Relevant Fields</field>
    <field name="res_model">project.issue</field>
    <field name="default" eval="True"/>
    <field name="description">The issue has been closed.</field>
</record>

Then whenever the field "field" is updated, all subtypes ("subtype_xml", "subtype_xml2") of this field are processed.

This means that the related method (in this example: lambda ...) is called and if the result is True, then for all users which follow this object and have checked the subtype a notification is created.

In the user preferences every user can choose whether he/she wants to be updated by email in case of new notifications.

You can also set a mail.message.subtype that depends on an other to act through a relation field. Here is an exemple from crm for Sales Teams crm.case.section using the section_id m2o in crm.lead:

    <record id="mt_lead_won" model="mail.message.subtype">
        <field name="name">Opportunity Won</field>
        <field name="res_model">crm.lead</field>
        <field name="default" eval="False"/>
        <field name="description">Opportunity won</field>
    </record>

    <record id="mt_salesteam_lead_won" model="mail.message.subtype">
        <field name="name">Opportunity Won</field>
        <field name="res_model">crm.case.section</field>
        <field name="parent_id" eval="ref('mt_lead_won')"/>
        <field name="relation_field">section_id</field>
    </record>

This allows a user to follow all "Opportunities Won" that are in a specific sales team. The user follow the event "Opportunity Won" on a sales team and he will become automatically follower of all leads/oppotunities of this sales team and _track event.

13
Avatar
Descartar
Fabien Pinckaers (fp)

I merged several answers into this one (thanks Yannick Vaucher)

Soohoo

Hi Fabien can you tell me how to track the amount change

Avatar
Yannick Payot
Mejor respuesta

To complete the answer from Andreas

You can also set a mail.message.subtype that depends on an other to act through a relation field. Here is an exemple from crm for Sales Teams crm.case.section using the section_id m2o in crm.lead:

    <record id="mt_lead_won" model="mail.message.subtype">
        <field name="name">Opportunity Won</field>
        <field name="res_model">crm.lead</field>
        <field name="default" eval="False"/>
        <field name="description">Opportunity won</field>
    </record>

    <record id="mt_salesteam_lead_won" model="mail.message.subtype">
        <field name="name">Opportunity Won</field>
        <field name="res_model">crm.case.section</field>
        <field name="parent_id" eval="ref('mt_lead_won')"/>
        <field name="relation_field">section_id</field>
    </record>
1
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
How auto subscribe to group?
follower mail messaging v7 track
Avatar
0
mar 15
6867
How does notifications, Inbox, To:Me, and Todo mailboxes work? Resuelto
mail messaging v7
Avatar
1
abr 23
27568
How can I manage my emails related to leads and opportunities?
mail messaging crm v7
Avatar
1
mar 15
18818
How to be in a document's followers ? Resuelto
project follower mail messaging crm
Avatar
Avatar
3
mar 16
12649
Which information is public in the messaging system on the bottom of documents?
security mail messaging public v7
Avatar
Avatar
1
mar 15
6400
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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