Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3951 Lượt xem

Assumption: fields.related is needed to display the fields of two related tables in the same view.

one2many, many2one and many2many can be specified in Field Type in Settings>Technical>Database Structure>Models Create: Fields

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Pulled from the documentation.  Here are the relevant part:

A special case of computed fields are related (proxy) fields, which provide the value of a sub-field on the current record. They are defined by setting the related parameter and like regular computed fields they can be stored:

nickname = fields.Char(related='user_id.partner_id.name', store=True)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 23
2185
2
thg 3 15
9485
2
thg 2 25
1030
0
thg 5 24
1387
1
thg 8 23
4306