你们能帮我指出在重复的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)"
您可以使用用户ie访问当前用户表单 qweb 报告,
<span t-esc="user.name"></span>
当前合作伙伴为
<span t-esc="user.partner_id.name"></span>
看看odoo 9报告文档
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句