无法在 odoo 8 中生成 pdf 报告

Can't generate pdf report in odoo 8

当我尝试打印客户发票时出现错误:

Traceback (most recent call last):
  File "/home/ubuntu/liveAMS/openerp/addons/report/controllers/main.py", line 121, in report_download
    response = self.report_routes(reportname, docids=docids, converter='pdf')
  File "/home/ubuntu/liveAMS/openerp/http.py", line 403, in response_wrap
    response = f(*args, **kw)
  File "/home/ubuntu/liveAMS/openerp/addons/report/controllers/main.py", line 65, in report_routes
    pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context)
  File "/home/ubuntu/liveAMS/openerp/api.py", line 256, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/ubuntu/liveAMS/openerp/addons/report/models/report.py", line 198, in get_pdf
    save_in_attachment = self._check_attachment_use(cr, uid, ids, report)
  File "/home/ubuntu/liveAMS/openerp/api.py", line 256, in wrapper
    return old_api(self, *args, **kwargs)
 File "/home/ubuntu/liveAMS/openerp/addons/report/models/report.py", line 345, in _check_attachment_use
    pdf = base64.decodestring(pdf)
 File "/usr/lib/python2.7/base64.py", line 321, in decodestring
   return binascii.a2b_base64(s)
TypeError: must be string or buffer, not None

已安装 wkhtmltopdf:wkhtmltopdf 0.12.2.1(已修补 qt)。

如何解决这个问题?

Odoo 可能正在尝试从数据库加载空 PDF。在这种情况下,试试这些:

  1. 启用调试/开发者模式 - 转到您的站点。com/web?debug

  2. 转到“设置”>“技术”>“报告”>“报告”

  3. 搜索 'invoices'

  4. 单击名称为 Invoices 且模板名称为 account.report_invoice

  5. 的报告记录
  6. 单击编辑

  7. 取消选中 Reload from attachment

  8. 单击保存

现在再次尝试打印发票。