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

Hello to all , I want to ask how I can create 2 many2one fields which have a relation with two fields of the same class.

   'my_products':fields.many2one('product.product','Parent'), 
   'product':fields.many2one('product.product','Product')

The problem is that both fields bring the same values of the fields of product.product . I want to create relation of many2one with two different fields of product.product. Please guide me

아바타
취소
베스트 답변

By default many2one field will show name field of object(product.product) in search list. You might can overwrite the name_search method for showing the different field of product object. This may help you but not for sure.

아바타
취소
작성자

but the problem is that in one many2one field , I do want to show names and its working ok . For the other many2one field, I want to relate other field. How can this be done ? It will be helpful if you please share some example or refer some link . Thanks

베스트 답변

It's possible. I think the code is ok. Please show the xml.

Update:

Pls. try:

<field name="product"/>
<field name="my_products"/>

아바타
취소
작성자

<field name="product"/>

관련 게시물 답글 화면 활동
1
8월 15
3236
1
3월 15
4766
1
3월 15
4367
1
3월 15
8944
2
4월 21
17259