Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2681 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
říj 18
7509
1
pro 16
6725
1
srp 16
3549
1
kvě 16
3234
3
bře 22
29655