当我尝试打印客户发票时出错:
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)。
如何解决这个问题?
答案 0 :(得分:1)
Odoo可能正在尝试从数据库加载空PDF。在这种情况下,请尝试以下方法:
启用调试/开发者模式 - 访问yoursite.com/web?debug
转到设置>技术>报告>报告
搜索“发票”
点击名称为Invoices
的报告记录和模板名称account.report_invoice
点击修改
取消选中Reload from attachment
点击保存
现在尝试再次打印发票。