Skip to Content
Menu
This question has been flagged
1 Reply
1694 Views

I have two classes  purchase_requisition and purchase_requisition_line .I want to show a value from purchase _requisition_line  class in purchase_requisition class.So far i have done this much 

    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'),
        }

and

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),
    }

I want to show product_id (ie Product name) in treeview of class but failed to do so, is there something i am missing?


Avatar
Discard
Best Answer

hello

the one2many field value you can not show on tree view of class(purchase.requisition)
you can make the tree view of the class (purchase.requisition.line)

Avatar
Discard
Related Posts Replies Views Activity
2
Oct 18
6480
1
Dec 16
5559
1
Aug 16
2400
1
May 16
2162
3
Mar 22
28232