تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
7258 أدوات العرض

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
نوفمبر 19
3469
0
يناير 25
1
3
نوفمبر 20
14616
2
مايو 19
20768
3
يوليو 24
22573