Skip to Content
Menu
This question has been flagged
1 Reply
18400 Views

When I create a email template using data from a excel file, an error occurred:

Odoo Server Error
Traceback (most recent call last):
  File "H:\Code\odoo12\odoo\odoo\http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "H:\Code\odoo12\odoo\odoo\http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "H:\Code\odoo12\odoo\odoo\tools\pycompat.py", line 87, in reraise
    raise value
  File "H:\Code\odoo12\odoo\odoo\http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "H:\Code\odoo12\odoo\odoo\http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "H:\Code\odoo12\odoo\odoo\service\model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "H:\Code\odoo12\odoo\odoo\http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "H:\Code\odoo12\odoo\odoo\http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "H:\Code\odoo12\odoo\odoo\http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "h:\code\odoo12\odoo\addons\web\controllers\main.py", line 966, in call_button
    action = self._call_kw(model, method, args, {})
  File "h:\code\odoo12\odoo\addons\web\controllers\main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "H:\Code\odoo12\odoo\odoo\api.py", line 749, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "H:\Code\odoo12\odoo\odoo\api.py", line 736, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "h:\code\odoo12\odoo\test\send_email\models\send_email.py", line 20, in action_send_email_from_excel
    workbook = xlrd.open_workbook(fp.name)
  File "D:\Python\lib\site-packages\xlrd\__init__.py", line 395, in open_workbook
    with open(filename, "rb") as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Gosu\\AppData\\Local\\Temp\\tmpfsa0rh35.xlsx'
Pls, help me? Thanks
Avatar
Discard
Best Answer

Hey Son,

Try to use sudo() in workbook like
workbook = xlrd.sudo().open_workbook(fp.name)

It might be helpfull to you for permission issue or you can share your code so we can check the issue.


Regards,




Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   


Avatar
Discard