我有两个purchase_requisition
和purchase_requisition_line
类。我想显示purchase_requisition_line
类中purchase_requisition
类的值。到目前为止,我已经做了很多
class purchase_requisition_line(osv.osv):
_name = "purchase.requisition.line"
_description = "Purchase Requisition Line"
_rec_name = 'product_id'
_columns = {
'product_id': fields.many2one('product.product','Product', domain=[('purchase_ok', '=', True)]),
'requisition_id': fields.many2one('purchase.requisition', 'Requisition', ondelete='cascade'),
}
和
class purchase_requisition(osv.osv):
_name = "purchase.requisition"
_description = "Purchase Requisition"
_inherit = ['mail.thread', 'ir.needaction_mixin']
_columns = {
'line_ids': fields.one2many('purchase.requisition.line', 'requisition_id', 'Products to Purchase', states={'done': [('readonly', True)]}, copy=True),
'product': fields.many2one('line_ids.product_id', string='Product', store=True),
}
我想在purchase_requisition
类的树状视图中显示product_id(即产品名称),但未能这样做,我是否缺少某些东西?这也是treeview的屏幕截图。