related field on odoo?

后端 未结 2 1949
轻奢々
轻奢々 2020-12-17 23:43

how to add a field related on odoo
I would like to add a text field on stock.move related to stock.picking origin field
I tried this :

_columns={         


        
相关标签:
2条回答
  • 2020-12-17 23:52

    You can find more information here : Link

    In the new API, there is not anymore fields.related. You should define your related field like this :

       sourcebl = fields.Char(string='Class Description', related='picking_id.origin')
    
    0 讨论(0)
  • 2020-12-17 23:55

    I used the old api it work fine now :

    _columns={
    'sourcebon': fields.related('picking_id', 'origin', string="Origin", type="char",store=True, readonly=True),
    }
    
    0 讨论(0)
提交回复
热议问题