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

Don't send automatic e-mail when confirming quotation?

Abonnieren

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

Diese Frage wurde gekennzeichnet
mailportalmail_threadodoo8.0
3 Antworten
9193 Ansichten
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi guys,

When you have portal activated you'll get an automatic e-mail saying something along these lines:

 Quotation confirmed
    • Customer: Yenthe
    • Untaxed Amount: 1.

The problem is that I do not want this message to be e-mailed. Any message should be e-mailed to the customer when the portal is active, except this one.
The message is made by the function format_message in mail/mail_thread.py:

 def format_message(message_description, tracked_values):
            message = ''
            if message_description:
                message = '<span>%s</span>' % message_description
            for name, change in tracked_values.items():
                message += '<div> &nbsp; &nbsp; &bull; <b>%s</b>: ' % change.get('col_info')
                if change.get('old_value'):
                    message += '%s &rarr; ' % change.get('old_value')
                message += '%s</div>' % change.get('new_value')
            return message
        if not tracked_fields:
            return True

This function posts the message to the view (in the chatter) but the problem is that somewhere else an action is triggered to send this message as an e-mail to the user.

So, my question, how can I / what is the best way to prevent this message to be send by email but allow anything else to be e-mailed to the customers?

Thanks,
Yenthe

1
Avatar
Verwerfen
Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Autor Beste Antwort

Hi guys,

Found the solution myself. In the module mail is a Python file named mail_thread. In mail_thread.py is a function def message_track(self, cr, uid, ids, tracked_fields, initial_values, context=None): and inside this function you will find the following code:

 for subtype in subtypes:
                subtype_rec = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, subtype, context=context)
                if not (subtype_rec and subtype_rec.exists()):
                    _logger.debug('subtype %s not found' % subtype)
                    continue
                message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)
                self.message_post(cr, uid, browse_record.id, body=message, subtype=subtype, context=context)
                posted = True
            if not posted:
                message = format_message('', tracked_values)
                self.message_post(cr, uid, browse_record.id, body=message, context=context)

When you change the message variable in the first if condition there will be no more automatic messages e-mailed, not even when the portal is activated.Result:

 for subtype in subtypes:
                subtype_rec = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, subtype, context=context)
                if not (subtype_rec and subtype_rec.exists()):
                    _logger.debug('subtype %s not found' % subtype)
                    continue
                message = format_message('', tracked_values)
                self.message_post(cr, uid, browse_record.id, body=message, context=context)
                posted = True
            if not posted:
                message = format_message('', tracked_values)
                self.message_post(cr, uid, browse_record.id, body=message, context=context)
0
Avatar
Verwerfen
Avatar
Axel Mendoza
Beste Antwort

You could read more about that here:

https://www.odoo.com/es_ES/forum/help-1/question/adding-messages-subtypes-for-product-changes-v7-91170#answer-91171

In your case you could disable that tracking of the needed fields just defining the field name in the _track dict with a lambda function that returns False like:

_track = {
    'field': {
'sale.mt_quotation.anything': lambda self, cr, uid, obj, ctx=None: False,
}
}
0
Avatar
Verwerfen
Axel Mendoza

it will have the same results like you have with the change, the difference is that you need to define all the field tracked in your model in the _track dict

Ehtesham

I am facing the same issue, I want to mute only email for this subtype message "Quotation Confirmed". Trying your method now.

Ehtesham

Thanks, I just tried and it works as expected however I don't want to include all fields in my child model. I just want 'sale.mt_order_confirmed' to be set false. So in my child model instead of this _track = { 'state': { 'sale.mt_order_confirmed': lambda self, cr, uid, obj, ctx=None: False, 'sale.mt_order_sent': lambda self, cr, uid, obj, ctx=None: obj.state in ['sent'] }, } I want something like this _track['state']['sale.mt_order_confirmed'] = lambda self, cr, uid, obj, ctx=None: False Excuse my syntax I am new to Python, I just want to change the targeted field's specific state. just to be future proof.

Axel Mendoza

Then you are ready to vote the answer :). The other scenario that you describe require the extension of the message_track method in your model extension to support that behavior

Avatar
Roman Gsponer
Beste Antwort

If anyone wants to prevent from sending quotations (no matter if it's a portal-user or not) you can use this:


class NoQuotationSaleOrder(models.Model):
_inherit = 'sale.order'

@api.multi
def action_quotation_send(self):
self.ensure_one()

if self.state != "sale":
return False

# Use this if you want to use the access token in your email-template:
self._portal_ensure_token()

return super(NoQuotationSaleOrder, self).action_quotation_send()


0
Avatar
Verwerfen
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
Odoo 8 mail problems: Admin receives all messages / notification of new mails not working
mail odoo8.0
Avatar
0
Juli 16
3980
'NoneType' object has no attribute 'id' on incoming mail server action.
mail mail_thread incomingemail
Avatar
0
Juni 21
4210
Correct way to use multiple outgoing mailservers for multiple users? Gelöst
mail mailserver odoo8.0
Avatar
Avatar
1
Apr. 21
12945
How to disable auto-add followers in discussion groups - copy solution from mail_thread.py?
follower mail odoo8.0
Avatar
Avatar
Avatar
2
März 16
10356
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
4608
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Ausbildung
  • 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