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

Problem with mail.thread inheritance to avoid subscribe of external partners

Suscribirse

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

Se marcó esta pregunta
v8inheritanceopenchattermail_thread
8685 Vistas
Avatar
Sandor Dobi

Hi,

The mail system has several flaws and nasty behaviour especially with information leak.

I describe a scenario:

Actors: Partner A -> External partner of the company, customer

User B, Manager C - > internal employees of the company.


Partner A  has a customer record in the odoo system with correct email adress.

1. Partner A sending an RFQ for Manager A and the odoo catchall interface catching that email and inserting into open chatter module. Author Partner A, recipient Manager C, subscriber Manager C.

2. Manager C forwarding this mail outside of odoo to User B and give hime instructions that he must prepare a quote.

3. Odoo's catchall interface importing this mail too, correctly recognizing that is member of mail thread which was started by Partner A. But here is a problem,

    The original mail and the forwarded mail got a new subscriber Partner A, and Partner A getting notifications about them, basically the Odoo system sending the forwarded mail to Partner A! This is the place of internal company information leak! After that time Partner A will get any information/mail (after importing them into the system with fetchmail job).


There is a boolean flag in res.partner (modified in mail addons) called 'notify_email' which controls the mails generated by notifications. Unfortunatelly it is defaults to True. But if we set this to False it wil lnot correct the problem because the partner getting subscribed to mail.thread only he don't get notifications. But this is an ann or nothing flag if we disable it then the Partner will not get any notifications, even the correct ones. 


So we need to implement a 'no_subscribe' flag and modify the mail.thread auto_subscribe and message_subscribe methods to be aware of that flag.


So we do the following:

class res_partner(orm.Model):

""" Update partner to add a field about notification preferences, and to set none as a default of notify_email """ name = "res.partner"
_inherit = ['res.partner']
columns = {
'no_subscribe': fields.boolean('Do not add as Follower automatically')
}

_defaults = {
'no_subscribe': True,
'notify_email': lambda *args: 'none'
}


class custom_mail_thread(orm.AbstractModel):
_inherit = "mail.thread"

def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None):

ids = self.pool.get('res.partner').search(cr, uid, [('no_subscribe','=',False), ('id','in', partner_ids)])
_logger.info(' MAIL.THREAD SUB: Filtering out partner ids:' + str(partner_ids) + ' result_ids:' + str(ids))
res = super(custom_mail_thread, self).message_subscribe(cr, uid, ids, ids, subtype_ids, context)
return res

def _message_auto_subscribe_notify(self, cr, uid, ids, partner_ids, context=None):

ids = self.pool.get('res.partner').search(cr, uid, [('no_subscribe','=',False), ('id','in', partner_ids)])
_logger.info(' MAIL.THREAD AUTO SUB NOTIFY: Filtering out partner ids:' + str(partner_ids) + ' result_ids:' + str(ids))
res = super(custom_mail_thread, self)._message_auto_subscribe_notify( cr, uid, ids, ids, context=None)
return res

As You see we are logging to log file both method call, and we expect them to be called, but there is a problem. The res.partner modification was ok there is a new field and we can see it, and the new default setting for notify_email is working too.

But our two new method was never called, we try several with several mails feeded into fetchmail cron job to see if they called or not and they are not called at all and we cannot change the errorneous behaviour of the mail.thread. 


Please help us to find the correct way  ti implement this change, and please help us to understand the quirks of odoo model inheritance, because we don't see the point why it not working at all.


Thanks


 




1
Avatar
Descartar
Dr Obx

Very interesting subject, I will follow it because I need something like that too.

¿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
followers from many2many field
v8 openchatter
Avatar
Avatar
1
jul 21
4351
Inherit view to another model
v8 views inheritance
Avatar
Avatar
1
sept 16
5261
How do you replace the module name with a nicer string in OpenChatter section?
v8 history openchatter
Avatar
1
mar 15
4560
Why can't I override the "name" field on the Sales Order Lines view? Resuelto
v8 views inheritance
Avatar
1
mar 15
7825
odoo v8 mail_thread displaying received html email with table inside, table width wider than parent div width
mail v8 css mail_thread
Avatar
1
jul 16
4763
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