Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing-
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

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

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
v8inheritanceopenchattermail_thread
8688 Ansichten
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
Verwerfen
Dr Obx

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

Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
followers from many2many field
v8 openchatter
Avatar
Avatar
1
Juli 21
4351
Inherit view to another model
v8 views inheritance
Avatar
Avatar
1
Sept. 16
5262
How do you replace the module name with a nicer string in OpenChatter section?
v8 history openchatter
Avatar
1
März 15
4564
Why can't I override the "name" field on the Sales Order Lines view? Gelöst
v8 views inheritance
Avatar
1
März 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
Juli 16
4766
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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