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

If I add "partner_shipping_id" to my Sale.Order TreeView, it will automatically show the name of the Delivery Address. I want to show the "city" or "place" of a Delivery Address rather than the name. How can I specify I want to show another field than the name of this Address?

I don't mind having to add a field e.g. "x_city" to the sale.order table, but how can I set this field to automatically store "partner_shipping_id.city" values? That way I can add x_city to my TreeView, and show it in my List View.

Is there a better way to do this? How?

아바타
취소
베스트 답변

You can use related field to display City.

'shipping_city': fields.related('partner_shipping_id', 'city', string='City', type='char')
아바타
취소
베스트 답변

You can use related field to display City.

Try this,

'shipping_city' : fields.related('partner_shipping_id','city', type='char', string='City', readonly=True),

Fields type in OpenERP.

아바타
취소
작성자

Hey Ghanshyam, this worked like a charm. Thanks for your perfect feedback.

작성자

I can't sort on this field though. Is this normal? May need to look into a different way to do this, because not being able to sort on location is a bit vague.

관련 게시물 답글 화면 활동
Sticky Field 해결 완료
1
11월 19
3915
0
1월 25
1
3
11월 20
15038
2
5월 19
21340
3
7월 24
23231