你能帮我指出正确的方法,在重复的qweb报告上显示当前用户(直接打印报告的人,而不是创建报告的人(吗?此外,我的目的是在二维码表单下设置名称。这是我的代码:
<div class="col-xs-3">
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('QR', o.name, 80, 80)" style="width:80px;height:80px;"/>
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('QR', o.user.name, 80, 80)" style="width:80px;height:80px;"/>
</div>
然后我得到这个 ERORR :
QWebException: "'sale.order' object has no attribute 'user'" while evaluating
"'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('QR', o.user.name, 80, 80)"
您可以使用用户访问当前用户表单qweb report,
<span t-esc="user.name"></span>
现任合伙人
<span t-esc="user.partner_id.name"></span>
看看odoo 9报告文档