Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to insert image to email signature?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
imageemailsignature
3 Respostes
19972 Vistes
Avatar
Erik Bruder

How can i add an image to my email signature in openerp 7?

2
Avatar
Descartar
Avatar
Reinhard Schneidewind
Best Answer

Hi,

you can add an inline-Image:

<img src="data:image/png;base64,${object.company_id.logo}" style="width: 250px;" />

But as the inline-Image gets removed by html-cleaner, you will have to use the following patch:

--- tools/mail.py.orig 2013-08-02 18:32:20.096029323 +0200 +++ tools/mail.py 2013-08-02 18:34:12.324027176 +0200 @@ -55,6 +55,9 @@

     # some corner cases make the parser crash (such as <SCRIPT/XSS SRC=\"\"></SCRIPT> in test_mail)
     try:
+       # thanks to stackoverflow questions/15386605/lxml-cleaner-to-ignore-base64-image for solution
+       cleaner_pattern = '\s*(?:javascript:|jscript:|livescript:|vbscript:|data:[^(?:image/.+;base64)]+|about:|mocha:)'
+       clean._javascript_scheme_re = re.compile(cleaner_pattern, re.I)
         cleaner = clean.Cleaner(page_structure=True, style=False, safe_attrs_only=False, forms=False, kill_tags=tags_to_kill, remove_tags=tags_to_remove)
         cleaned = cleaner.clean_html(src)
     except TypeError, e:

Hope this helps.

Best regards,

Reinhard

1
Avatar
Descartar
venugopal voraganti

I done as you told, but no use????please can u explain in brief......

Avatar
Ivan Elizaryev
Best Answer

You can add attribute sanitize=False to signature field at openerp/addons/base/res/res_users.py file

 'signature': fields.html('Signature', sanitize=False)


Unfortunally not all email clients shows base64 encoded images. Such images should be replaces by attachments. You can overwrite build_email function of a ir.mail_server model:

class ir_mail_server(models Mode): 
_inherit
= "ir.mail_server" def build_email(self, email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attachments=None, message_id=None, references=None, object_id=False, subtype='plain', headers=None, body_alternative=None, subtype_alternative='plain'): """ copy-pasted from openerp/addons/base/ir/ir_mail_server.py::build_email """ ftemplate = '__image-%s__' fcounter = 0 attachments = attachments or [] pattern = re.compile(r'"data:image/png;base64,[^"]*"') pos = 0 new_body = '' while True: match = pattern.search(body, pos) if not match: break s = match.start() e = match.end() data = body[s+len('"data:image/png;base64,'):e-1] new_body += body[pos:s] fname = ftemplate % fcounter fcounter += 1 attachments.append( (fname, base64.b64decode(data)) ) new_body += '"cid:%s"' % fname pos = e new_body += body[pos:] body = new_body //...


Or you can just try my module res_users_signature which also add signature templates feature.

0
Avatar
Descartar
Dairidi

Hi Ivan, I installed your modul. But when I use the same example like you with . I don't get an Image. I only get the base64 encoded Image and it don't show something else then the base64 string. Any idea? Thanks

Dairidi

Hi Ivan, I installed your modul. But when I use the same example like you with ${user.company_id.logo_web}. I don't get an Image. I only get the base64 encoded Image and it don't show something else then the base64 string. Any idea? Thanks

Moisés Augusto López Calderón

Hello @IvanYelizariev Thanks for reply The real patch that applied was: https://gist.github.com/moylop260/c9ed3703f3ad05133c5c10974c907a0a really?

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Email signature (set on User Preferences) not showing on Mails or Messages
email signature
Avatar
Avatar
1
d’abr. 25
4883
Images in email (v10)
image email
Avatar
0
de set. 17
3220
Automate sending sign request thru email not working
email automated signature
Avatar
0
de febr. 25
2203
Adding email signature to emails sent from CRM [v12] Solved
crm email signature
Avatar
Avatar
Avatar
Avatar
Avatar
4
d’ag. 24
9364
to add signature in the footer email
email signature footer
Avatar
Avatar
1
de des. 23
4828
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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