Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
608 มุมมอง

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

อวตาร
ละทิ้ง