Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

changing email template gives error for sending emails

By
Benjamin
on 5/13/16, 5:59 PM 693 views

Hi,

I was sending emails to clients with their invoices and quotations, however it was showing double of my signature, so i edited the file, in odoo 9, debug mode, i went to emails, and them templates.

after editing the file, i now get this error when trying to send emails:  (anyone has the original files so i an revert it and make it work again?)

Odoo Server Error

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 680, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 959, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/site-packages/openerp/addons/web/controllers/main.py", line 896, in call_button
    action = self._call_kw(model, method, args, {})
  File "/usr/lib/python2.7/site-packages/openerp/addons/web/controllers/main.py", line 884, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 381, in old_api
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/wizard/mail_compose_message.py", line 190, in send_mail_action
    return self.with_context(report_template_in_attachment=True).send_mail()
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/sale/sale.py", line 818, in send_mail
    return super(MailComposeMessage, self.with_context(mail_post_autofollow=True)).send_mail(auto_commit=auto_commit)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/account/models/account_invoice.py", line 1368, in send_mail
    return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/wizard/mail_compose_message.py", line 247, in send_mail
    ActiveModel.browse(res_id).message_post(message_type='comment', subtype=subtype, **mail_values)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/models/mail_thread.py", line 1734, in message_post
    new_message = MailMessage.create(values)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/models/mail_message.py", line 873, in create
    user_signature=self.env.context.get('mail_notify_user_signature', True))
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/models/mail_message.py", line 935, in _notify
    partners._notify(self, force_send=force_send, user_signature=user_signature)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/models/res_partner.py", line 138, in _notify
    ('notify_email', '!=', 'none')])._notify_by_email(message, force_send=force_send, user_signature=user_signature)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/mail/models/res_partner.py", line 178, in _notify_by_email
    new_emails, new_recipients_nbr = self._notify_send(fol_values['body'], fol_values['subject'], recipient_template_values['followers'], **base_mail_values)
KeyError: 'body'

You can always find the original template on the GitHub ... (Odoo/Odoo) Could you check that you don't hAve another trace back related just before this one ... Else, please provide an export of your current template mail ...

Jérémy Kersten (jke)
on 5/14/16, 1:53 AM
0
Benjamin
On 5/14/16, 10:25 PM

how do i find in the github the template for the emails?  i cant find it.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 5/13/16, 5:59 PM
Seen: 693 times
Last updated: 5/15/16, 2:00 PM