Hi guys,
I'm using the email_template.py in sale module and the function sends an email with the quotation to the customer. When using my code as admin, it works fine.
When using the same page as normal user I get following error and can't find the reason:
OpenERP Server Error
Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/openerp/http.py", line 499, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/local/lib/python2.7/site-packages/openerp/http.py", line 516, in dispatch result = self._call_function(**self.params) File "/usr/local/lib/python2.7/site-packages/openerp/http.py", line 282, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/openerp/http.py", line 279, in checked_call return self.endpoint(*a, **kw) File "/usr/local/lib/python2.7/site-packages/openerp/http.py", line 732, in __call__ return self.method(*args, **kw) File "/usr/local/lib/python2.7/site-packages/openerp/http.py", line 375, in response_wrap response = f(*args, **kw) File "/var/packages/Odoo8/target/addons/web/controllers/main.py", line 944, in call_kw return self._call_kw(model, method, args, kwargs) File "/var/packages/Odoo8/target/addons/web/controllers/main.py", line 936, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/var/packages/Odoo8/target/addons/email_template/wizard/mail_compose_message.py", line 54, in default_get res.get('model'), res.get('res_id'), context=context File "/usr/local/lib/python2.7/site-packages/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/var/packages/Odoo8/target/addons/email_template/wizard/mail_compose_message.py", line 103, in onchange_template_id values = self.generate_email_for_composer_batch(cr, uid, template_id, [res_id], context=context)[res_id] File "/usr/local/lib/python2.7/site-packages/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/var/packages/Odoo8/target/addons/email_template/wizard/mail_compose_message.py", line 167, in generate_email_for_composer_batch template_values = self.pool.get('email.template').generate_email_batch(cr, uid, template_id, res_ids, fields=fields, context=ctx) File "/usr/local/lib/python2.7/site-packages/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/var/packages/Odoo8/target/addons/email_template/email_template.py", line 489, in generate_email_batch values['body_html'] = tools.append_content_to_html(values['body_html'], signature, plaintext=False) File "/usr/local/lib/python2.7/site-packages/openerp/tools/mail.py", line 582, in append_content_to_html content = re.sub(r'(?i)(</?html.*>|</?body.*>|<!\W*DOCTYPE.*>)', '', content) File "/usr/lib/python2.7/re.py", line 155, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or buffer
Side note: Odoo version 8 running on linux.
Thanks for any help or advice.
can the user have no permission? can you put your code?