Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Override mail template in Odoo 9

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
mailtemplate
5 Risposte
10709 Visualizzazioni
Avatar
Mario Gielissen

Is it possible to make changes to addons/mail/data/mail_data.xml, without changing the file itself, but with a custom module?

I want to change the header with send with Odoo removed

0
Avatar
Abbandona
Mario Gielissen
Autore

I tried it with this, but no luck:


<record id="mail_template_data_notification_email_default" model="mail.template">

<field name="body_html">=

Avatar
Prakash
Risposta migliore

create the demo data with the same id  in your custom module

And  in parallel use delete  tag to delete the already created demo data like

<delete model='mail.mail' search="[('id','=',ref('mail.ir_cron_mail_scheduler_action'))]" />
1
Avatar
Abbandona
Avatar
Raffaele Del Gatto
Risposta migliore

Hi Mario, more then 3 years has passed since your request, so I guess you already found a solution, but I will post what I've made here as reference for anyone who got similar issues.

For what I've seen googling around many people suggest to override the original template by simply putting the model name followed by the name of the template view. But this alone will not work. One way to force it works, by fooling the noupdate field, is to delete the template and create a new one with the original id, as suggested here by Prakash. However, this is very risky, since other models my reference the original template.

So, I've made an override of the _rendere_template method in the mail.template Class:

class MailTemplate(models.Model):
_name = 'mail.template'
_inherit = 'mail.template'

mail_template = []

@api.model
def _render_template(self, template_txt, model, res_ids, post_process=False):
import pdb; pdb.set_trace()
self.mail_template.append(self.__dict__['_prefetch']['mail.template'])
if your_template_id in self.mail_template[0]:
if model == 'project.task' and post_process is True:
if type(res_ids) is list:
if template_txt:
template_txt = """
put your body_html text here
"""
res = super(MailTemplate, self)._render_template(template_txt, model, res_ids, post_process)
return res

The html_body is contained in the template_txt variable when post_process is true (this is method is called in a for cycle where all the template fields are passed, so we need to make sure to rewrite the template_txt when this is really the html_body). Then we need to pass the id of the template we want to override, otherwise we will override any mail template, each time we are gonna send an email (which, of course, is no good).

Hope this will help other people who want to override an original mail template without deleting it.

Cheers, 

0
Avatar
Abbandona
Avatar
Edser Solis
Risposta migliore

If what you're looking for is to remove the sent using odoo message search for the Notification Emails template and remove that whole small code paragraph that you can see there at the right. 

0
Avatar
Abbandona
Mario Gielissen
Autore

I know that, but I want to use a module for that: For odoo 9+ footer can be customized via Template Activate developer mode (Top right-hand corner -> About) Navigate to Settings\Technical\Email\Templates Select (set checkbox) "Notification Email" record click Action ->Export add field "Body" to export fields click "Export to Field" open csv via your editor Change footer as you need Navigate to Settings\Technical\Email\Templates click "Import" Validate and Import your file

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
HOW TO CALL CUSTOM CSS IN MAIL TEMPLATE Risolto
mailtemplate odoo10
Avatar
Avatar
Avatar
Avatar
3
mar 23
8011
How to use a dict to add custom values to mail template? Risolto
mailtemplate odoo10
Avatar
5
dic 22
14598
Email template not show in Compose Email Risolto
mailtemplate mail.compose
Avatar
1
feb 22
3674
How to replace password reset mail template with custom template in Odoo 13 CE?
mailtemplate odoo13CE
Avatar
Avatar
1
lug 20
6501
How to show custom text in mail template in Odoo 13 CE?
mailtemplate odoo13CE
Avatar
Avatar
1
mag 20
4088
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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