我正在尝试在 qweb pdf 报告中打印 many2many 字段值
以下是代码
购买报价.py
class purchase_quotation(osv.Model):
_name="purchase.quotation"
_rec_name='vno'
_columns={
'name':fields.many2one('res.users','Name', readonly=True),
'date':fields.date('Order Date', required=True),
'vno':fields.char('Voucher No',size=40,readonly=1),
'branch':fields.selection([
('blockA', 'Block A'),
('blockB', 'Block B'),
('admin', 'Admin'),
], 'Branch/Office', readonly= False, select=True, required=True),
'user_manager_id':fields.many2one('res.users','Manager'),
'approve_by':fields.char('Approved By'),
'order_line': fields.one2many('product.text', 'pro_ref', 'Order Lines',required=True),
}
采购订单.py
class purchase_order(osv.osv):
_inherit = "purchase.order"
_columns = {
'vno_ref':fields.many2many('purchase.quotation', 'voch_ref' , string='Ref.Voucher No'),
'spo':fields.many2one('res.users','Submit To', domain = [('is_approver','=',True)],),
}
qweb pdf报告中的代码
<div class="col-xs-4 pull-right">
<strong>Order Date:</strong>
<p t-field="o.date_order" t-field-options='{"widget": "date"}'/>
<strong>Ref Voucher No:</strong>
<p t-field="o.vno_ref"/>
</div>
如何在 qweb pdf 报告中显示 many2many 字段的值。有人对此有想法吗?谢谢