콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
15103 화면

Hello, I am developing a module in Odoo8.

I have a relation between two models. Model A has a one2many relation pointing to model B, and model B has Many2one relation pointing to model A.

In a view of model A I want to select one or more items of model B. But if I put a field like <field name="name_of_one2many_relation" /> I can create one or more records of model B and relate them with record of model A. I want to select previously created records of model B, not create new ones. How can I do this?

Thanks!
 

아바타
취소
베스트 답변

Hello José,

I would suggest to use many2many field which will allow you to select existing records unlike one2many where you have to create the recrods.

아바타
취소
베스트 답변

You can also still use one2many field with many2many_list widget. Just set widget='many2many_list' in the name_of_one2many_relation fields tag in the view and you get the many2many list behaviour (selecting from existing record, etc.) from a one2many field. It also applicable vv (many2many using one2many_list widget).

아바타
취소
관련 게시물 답글 화면 활동
1
11월 21
5178
0
1월 21
2484
8
5월 20
8093
0
12월 23
3089
1
5월 19
4518