Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of related fields in OpenERP?

Tags:

python

openerp

Can someone explain to me something about related fields. For example -

  • How it was used
  • How it can be helped
  • For which kind of scenario I should use fields.related

If anybody can provide a small example for real use of fields.related I would appreciate it.

like image 283
necromancer Avatar asked Oct 08 '10 04:10

necromancer


1 Answers

It lets you pull a field from a related table. You can find more details in the developer book, and one example to look at is the order_partner_id field of the sale_order_line class. In version 5.14, that's at line 806 of addons/sale/sale.py.

I often find that I want to display a field in a list, but it's on a parent record instead of the actual table that I'm listing.

like image 65
Don Kirkby Avatar answered Oct 05 '22 18:10

Don Kirkby