Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2683 Prikazi

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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
okt. 18
7513
1
dec. 16
6729
1
avg. 16
3551
1
maj 16
3236
3
mar. 22
29656