Skip to Content
Menu
This question has been flagged
2 Replies
607 Views

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!

Avatar
Discard
Author

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?

Best Answer

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

Avatar
Discard
Best Answer

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

Avatar
Discard