When I tried to send a confirmation email of a delivery I receive the following errors:
UI:
Fehler beim Erstellen der Vorlage <Template memory:7fdd491f2780> mit den Werten {'format_date': <function MailTemplate.render_template.<locals>.<lambda> at 0x7fdd618599d8>, 'format_tz': <function MailTemplate.render_template.<locals>.<lambda> at 0x7fdd61859a60>, 'format_amount': <function MailTemplate.render_template.<locals>.<lambda> at 0x7fdd61859400>, 'user': res.users(1,), 'ctx': {'lang': 'de_DE', 'tz': 'Europe/Berlin', 'uid': 6, 'params': {'action': 140, 'id': 46, 'view_type': 'form', 'model': 'stock.picking', 'active_id': 4, '_push_me': False}, 'contact_display': 'partner_address', 'search_disable_custom_filters': True, 'active_model': 'stock.picking', 'active_id': 46, 'active_ids': [46], 'default_composition_mode': 'comment', 'default_res_id': 46, 'default_model': 'stock.picking', 'default_use_template': True, 'default_template_id': 12, 'custom_layout': 'delivery.mail_template_data_delivery_notification', 'mail_notify_user_signature': False, 'mail_auto_delete': True, 'signature': False, 'website_url': 'http://www.my_company.com', 'company': res.company(1,), 'company_name': 'My Company', 'model_name': 'Lieferung vornehmen', 'record': stock.picking(46,), 'record_name': 'L1850043', 'tracking': [], 'is_discussion': True, 'subtype': mail.message.subtype(1,), 'has_button_access': False, 'has_button_follow': False, 'has_button_unfollow': False, 'button_access': {'url': '/mail/view?message_id=1396', 'title': 'Lieferung vornehmen ansehen'}, 'button_follow': {'url': '/mail/follow?model=stock.picking&res_id=46&token=11f51c44315878827d96e67d13121609a599e68b', 'title': 'Abonnieren'}, 'button_unfollow': {'url': '/mail/unfollow?model=stock.picking&res_id=46&token=785241b52ca29b6e4b22b3237387e4b240cff00e', 'title': 'Nicht mehr abonnieren'}, 'actions': [], 'followers': res.partner(), 'not_followers': res.partner(67,), 'safe': False}, 'object': mail.message(1396,)}
Log:
Traceback (most recent call last):
File "/opt/odoo/odoo11/addons/mail/models/mail_template.py", line 371, in render_template
render_result = template.render(variables)
File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 989, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/dist-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "<template>", line 13, in top-level template code
File "/usr/local/lib/python3.6/dist-packages/jinja2/sandbox.py", line 329, in getattr
value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'company' is undefined
If I switch the language of the user attempting to send this email to english, it's working - so I guess it's not an issue of the template, right?
well, translation error: yes! But where is it?