odoo v8申请单行

时间:2018-12-20 08:56:58

标签: python odoo odoo-8 odoo-view

我有两个purchase_requisitionpurchase_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的屏幕截图。 enter image description here

0 个答案:

没有答案