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

I have been able to add 'show_address':1 to the partner_id field in my Helpdesk form view, but I'd like it show the delivery address instead.  Is there a way I can specify which address it should display?  Or create a separate related field to show the delivery address?

Using Odoo 16 Studio.

Thanks!

아바타
취소
작성자

What I want to do is view the delivery address for the selected customer in the Helpdesk ticket form view. Currently, I can display the default address of the contact when I apply the context "show_address":1 to the partner_id field, but how can I show the related delivery address for the same partner_id?

베스트 답변

Hi Aaron,

To achieve your requirement, you can create a new many2one field that relates to the 'res.partner' model. Then, write a compute function for that field using 'partner_id' it as the dependency field. The function should look like this:

for order in self:
    order['delivery_address_id'] = order.partner_id.address_get(['delivery'])['delivery'] if order.partner_id else False

Hope it helps

아바타
취소
베스트 답변

Hi,
You can create a new field and let the customer/end user select the delivery address in it, or even on the change of partner_id field you can set a default value in this field and show address for this field.

See:  Add Onchange Function From User Interface In Odoo



Thanks

아바타
취소