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

I'm using Odoo Studio and i just created 2 models (new models, not using existing models) and i want to link the 2 models so i can access fields of the 1st model from the 2nd model. I tried using related fields and one2many or many2one but i can't find fields of the 1st model from the 2nd model. Can anybody help?

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

If you want to access fields from the 1st model from the 2nd mode, if the 2nd model will linked to one record of the 1st model then you will use Many2one field in 2nd model and select the 1st model name. then to access other fields in 1st model use the related field and select the field Many2one field which you added and then select the required field and repeat this to add another related field.. 

Check the below link for more details.

Adding relational fields using Odoo Studio – Odoo tricks and tips

Hope this will help you.

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

thanks, it worked

Ảnh đại diện
Huỷ bỏ

Great. You can vote the answer.