İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
1195 Görünümler

When I make an order and have to select a delivery address I get every address from my contacts in the dropdown menu, also the ones which have nothing to do with this specific customer.


Could someone explain to me if it is possible in Odoo Online (v18) to adjust with Studio the delivery address field in a sales order so that only the delivery addresses from the selected customer are being shown instead of all the addresses which I currently have in my database?


Thank you in advance!


Avatar
Vazgeç

i have the same problem! :-(

Üretici

Dear Abhay,

Thank you very much for your response.

When I try to add the domain in the domain field I get a pop-up where I can set a domain using a rule, I can not just add the code in the domain field.

I also tried pasting the code in the code editor field, unfortunaly this also does not work.

Am I missing something?

Thank you in advance!


En İyi Yanıt

Hii,

Open Odoo Studio 

Open the Sales Order form view.

Click on the "Delivery Address" field (partner_shipping_id).

In the right-side panel, scroll to "Domain" or "Filter domain" (depends on the version).

Add the following domain filter:

[('type', '=', 'delivery'), ('parent_id', '=', partner_id)]

type = delivery ensures only delivery addresses.

parent_id = partner_id ensures the contact belongs to the selected customer.

Save the changes and exit Studio.
i hope it is use full

Avatar
Vazgeç
En İyi Yanıt

Yes, in Odoo Online (v18) using Odoo Studio, you can limit the Delivery Address field in a Sales Order so it only shows addresses related to the selected customer (partner). Here's how you can add a domain filter using Odoo Studio:

  • Go to Sales > Orders > Sales Orders.
  • Open any Sales Order or create a new one.
  • Click the Studio (wrench icon) in the top-right corner.
  • Click on the "Delivery Address" field (it's a Many2one to res.partner).
  • In the right panel, scroll to the "Domain" section.
  • Add the domain: [('parent_id','=',partner_id)]
  • Close Studio.


Thanks,
Abhay

Avatar
Vazgeç
En İyi Yanıt

Hi! This doesn't work for me. I get a domain error:

"Domain is invalid. Please correct it."

I copied exactly what you said in the domain code editor:

[('parent_id','=',partner_id)]

I also don't understand why this doesn't work. It makes sense. I'm trying to filter the list where contacts have a parent set against them that is the main contact selected for the sales order / quotaiton.

Help!

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Eyl 25
181
3
Ağu 25
269
4
Ağu 25
1473
Block sale. Çözüldü
3
Ağu 25
490
2
Ağu 25
572